Uploaded image for project: 'MariaDB ColumnStore'
  1. MariaDB ColumnStore
  2. MCOL-6133

Columnstore build failure with GCC 16

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 6.4.10
    • None
    • Build
    • None
    • Gentoo

    Description

      The MariaDB 10.6.23 and 10.11.14 fails to build build with GCC 16 with following error:

      /usr/lib/gcc/x86_64-pc-linux-gnu/16/include/g++-v16/bits/stl_tree.h: In instantiation of ‘bool std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_key_compare(const _Key1&, const _Key2&) const [with _Key1 = {anonymous}::FdCountEnt
      ry; _Key2 = {anonymous}::FdCountEntry; _Key = {anonymous}::FdCountEntry; _Val = {anonymous}::FdCountEntry; _KeyOfValue = std::_Identity<{anonymous}::FdCountEntry>; _Compare = {anonymous}::fdCountCompare; _Alloc = std::allocator<{anonymous}
      ::FdCountEntry>]’:
      /usr/lib/gcc/x86_64-pc-linux-gnu/16/include/g++-v16/bits/stl_tree.h:2775:24:   required from ‘std::pair<typename std::__rb_tree::_Node_traits<_Val, typename __gnu_cxx::__alloc_traits<typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Val>
      ::other>::pointer>::_Base_ptr, typename std::__rb_tree::_Node_traits<_Val, typename __gnu_cxx::__alloc_traits<typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Val>::other>::pointer>::_Base_ptr> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Co
      mpare, _Alloc>::_M_get_insert_equal_pos(const key_type&) [with _Key = {anonymous}::FdCountEntry; _Val = {anonymous}::FdCountEntry; _KeyOfValue = std::_Identity<{anonymous}::FdCountEntry>; _Compare = {anonymous}::fdCountCompare; _Alloc = st
      d::allocator<{anonymous}::FdCountEntry>; typename std::__rb_tree::_Node_traits<_Val, typename __gnu_cxx::__alloc_traits<typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Val>::other>::pointer>::_Base_ptr = std::__rb_tree::_Node_traits<{a
      nonymous}::FdCountEntry, {anonymous}::FdCountEntry*>::_Node_base*; typename __gnu_cxx::__alloc_traits<typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Val>::other>::pointer = {anonymous}::FdCountEntry*; typename __gnu_cxx::__alloc_trait
      s<_Alloc>::rebind<_Val>::other = std::allocator<{anonymous}::FdCountEntry>; typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Val> = __gnu_cxx::__alloc_traits<std::allocator<{anonymous}::FdCountEntry>, {anonymous}::FdCountEntry>::rebind<
      {anonymous}::FdCountEntry>; typename _Alloc::value_type = {anonymous}::FdCountEntry; typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Val>::other::value_type = {anonymous}::FdCountEntry; key_type = {anonymous}::FdCountEntry]’
       2775 |           __x = _M_key_compare(__k, _S_key(__x)) ? _S_left(__x) : _S_right(__x);
            |                 ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
      /usr/lib/gcc/x86_64-pc-linux-gnu/16/include/g++-v16/bits/stl_tree.h:2823:4:   required from ‘std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_insert_equal(_Arg&
      &) [with _Arg = const {anonymous}::FdCountEntry&; _Key = {anonymous}::FdCountEntry; _Val = {anonymous}::FdCountEntry; _KeyOfValue = std::_Identity<{anonymous}::FdCountEntry>; _Compare = {anonymous}::fdCountCompare; _Alloc = std::allocator<
      {anonymous}::FdCountEntry>; iterator = std::_Rb_tree<{anonymous}::FdCountEntry, {anonymous}::FdCountEntry, std::_Identity<{anonymous}::FdCountEntry>, {anonymous}::fdCountCompare, std::allocator<{anonymous}::FdCountEntry> >::iterator]’
       2823 |         = _M_get_insert_equal_pos(_KeyOfValue()(__v));
            |           ^~~~~~~~~~~~~~~~~~~~~~~
      /usr/lib/gcc/x86_64-pc-linux-gnu/16/include/g++-v16/bits/stl_multiset.h:527:36:   required from ‘std::multiset<_Key, _Compare, _Alloc>::iterator std::multiset<_Key, _Compare, _Alloc>::insert(const value_type&) [with _Key = {anonymous}::FdC
      ountEntry; _Compare = {anonymous}::fdCountCompare; _Alloc = std::allocator<{anonymous}::FdCountEntry>; iterator = std::_Rb_tree<{anonymous}::FdCountEntry, {anonymous}::FdCountEntry, std::_Identity<{anonymous}::FdCountEntry>, {anonymous}::f
      dCountCompare, std::allocator<{anonymous}::FdCountEntry> >::const_iterator; value_type = {anonymous}::FdCountEntry]’
        527 |       { return _M_t._M_insert_equal(__x); }
            |                ~~~~~~~~~~~~~~~~~~~~^~~~~
      /var/tmp/portage/dev-db/mariadb-10.11.14/work/mysql/storage/columnstore/columnstore/primitives/blockcache/iomanager.cpp:606:31:   required from here
        606 |             fdCountSort.insert(fdc);
            |             ~~~~~~~~~~~~~~~~~~^~~~~
      /usr/lib/gcc/x86_64-pc-linux-gnu/16/include/g++-v16/bits/stl_tree.h:1402:72: error: static assertion failed: comparison object must be invocable with two arguments of key type
       1402 |             __is_invocable<const _Compare&, const _Key&, const _Key&>::value,
            |                                                                        ^~~~~
      /usr/lib/gcc/x86_64-pc-linux-gnu/16/include/g++-v16/bits/stl_tree.h:1402:72: note: ‘std::integral_constant<bool, false>::value’ evaluates to false
      /usr/lib/gcc/x86_64-pc-linux-gnu/16/include/g++-v16/bits/stl_tree.h:1406:40: error: no match for call to ‘(const {anonymous}::fdCountCompare) (const {anonymous}::FdCountEntry&, const {anonymous}::FdCountEntry&)’
       1406 |           return _M_impl._M_key_compare(__k1, __k2);
            |                  ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
      /var/tmp/portage/dev-db/mariadb-10.11.14/work/mysql/storage/columnstore/columnstore/primitives/blockcache/iomanager.cpp:258:8: note: there is 1 candidate
        258 | struct fdCountCompare
            |        ^~~~~~~~~~~~~~
      /var/tmp/portage/dev-db/mariadb-10.11.14/work/mysql/storage/columnstore/columnstore/primitives/blockcache/iomanager.cpp:260:8: note: candidate 1: ‘bool {anonymous}::fdCountCompare::operator()(const {anonymous}::FdCountEntry_t&, const {anon
      ymous}::FdCountEntry_t&)’ (near match)
        260 |   bool operator()(const FdCountEntry_t& lhs, const FdCountEntry_t& rhs)
            |        ^~~~~~~~
      /var/tmp/portage/dev-db/mariadb-10.11.14/work/mysql/storage/columnstore/columnstore/primitives/blockcache/iomanager.cpp:260:8: note: passing ‘const {anonymous}::fdCountCompare*’ as ‘this’ argument discards qualifiers
      

      However, this does not affect more recent series. I located the fix, cherry-picked it for 10.6.23, which builds just fine with it:

      Author: Leonid Fedorov <leonid.fedorov@mariadb.com>
      Date:   Tue Oct 26 15:02:34 2021 +0000
       
          c++17 fix
       
          (cherry picked from commit 1973168e03d90d8c6da590df2f31982dd400ea0b)
       
      diff --git a/primitives/blockcache/iomanager.cpp b/primitives/blockcache/iomanager.cpp
      index d8cae6f39..b1b727797 100644
      --- a/primitives/blockcache/iomanager.cpp
      +++ b/primitives/blockcache/iomanager.cpp
      @@ -257,7 +257,7 @@ typedef FdCountEntry FdCountEntry_t;
       
       struct fdCountCompare
       {
      -  bool operator()(const FdCountEntry_t& lhs, const FdCountEntry_t& rhs)
      +  bool operator()(const FdCountEntry_t& lhs, const FdCountEntry_t& rhs) const
         {
           return lhs.cnt > rhs.cnt;
         }
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            arkamar Petr Vaněk
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.