xtrabackup 2.4.x doesn't compile on MacOS X anymore

Bug #1736119 reported by Andreas 'count' Kotes
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona XtraBackup moved to https://jira.percona.com/projects/PXB
Status tracked in 2.4
2.3
Invalid
Undecided
Unassigned
2.4
Fix Released
Medium
Sergei Glushchenko

Bug Description

[ 25%] Building CXX object storage/innobase/CMakeFiles/innobase.dir/buf/buf0buf.cc.o
In file included from /Users/count/scratch/percona-xtrabackup-2.4.9/storage/innobase/buf/buf0buf.cc:33:
In file included from /Users/count/scratch/percona-xtrabackup-2.4.9/storage/innobase/include/ha_prototypes.h:32:
In file included from /Users/count/scratch/percona-xtrabackup-2.4.9/storage/innobase/include/univ.i:600:
In file included from /Users/count/scratch/percona-xtrabackup-2.4.9/storage/innobase/include/sync0types.h:32:
In file included from /Users/count/scratch/percona-xtrabackup-2.4.9/storage/innobase/include/ut0new.h:124:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/map:820:5: error: static_assert failed "Allocator::value_type must be same type as value_type"
    static_assert((is_same<typename allocator_type::value_type, value_type>::value),
    ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__config:729:36: note: expanded from macro 'static_assert'
# define static_assert(__b, __m) _Static_assert(__b, __m)
                                   ^ ~~~
/Users/count/scratch/percona-xtrabackup-2.4.9/storage/innobase/buf/buf0buf.cc:395:19: note: in instantiation of template class 'std::__1::map<const unsigned char *, buf_chunk_t *, std::__1::less<const unsigned char *>, ut_allocator<std::__1::pair<const unsigned char *, buf_chunk_t *> > >' requested here
        buf_chunk_map_reg->insert(buf_pool_chunk_map_t::value_type(
                         ^
/Users/count/scratch/percona-xtrabackup-2.4.9/storage/innobase/buf/buf0buf.cc:3927:2: error: no type named 'iterator' in 'std::__1::map<const unsigned char *, buf_chunk_t *, std::__1::less<const unsigned char *>, ut_allocator<std::__1::pair<const unsigned char *, buf_chunk_t *> > >'; did you mean
      'TrxUndoRsegs::iterator'?
        buf_pool_chunk_map_t::iterator it;
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        TrxUndoRsegs::iterator
/Users/count/scratch/percona-xtrabackup-2.4.9/storage/innobase/include/trx0types.h:186:32: note: 'TrxUndoRsegs::iterator' declared here
        typedef trx_rsegs_t::iterator iterator;
                                      ^
/Users/count/scratch/percona-xtrabackup-2.4.9/storage/innobase/buf/buf0buf.cc:3936:18: error: no member named 'upper_bound' in 'std::__1::map<const unsigned char *, buf_chunk_t *, std::__1::less<const unsigned char *>, ut_allocator<std::__1::pair<const unsigned char *, buf_chunk_t *> > >'
        it = chunk_map->upper_bound(bound);
             ~~~~~~~~~ ^
/Users/count/scratch/percona-xtrabackup-2.4.9/storage/innobase/buf/buf0buf.cc:3938:24: error: no member named 'end' in 'std::__1::map<const unsigned char *, buf_chunk_t *, std::__1::less<const unsigned char *>, ut_allocator<std::__1::pair<const unsigned char *, buf_chunk_t *> > >'
        ut_a(it != chunk_map->end());
                   ~~~~~~~~~ ^
/Users/count/scratch/percona-xtrabackup-2.4.9/storage/innobase/include/ut0dbg.h:52:30: note: expanded from macro 'ut_a'
        if (UNIV_UNLIKELY(!(ulint) (EXPR))) { \
                                    ^~~~
/Users/count/scratch/percona-xtrabackup-2.4.9/storage/innobase/include/univ.i:574:41: note: expanded from macro 'UNIV_UNLIKELY'
#define UNIV_UNLIKELY(cond) UNIV_EXPECT(cond, FALSE)
                                        ^~~~
/Users/count/scratch/percona-xtrabackup-2.4.9/storage/innobase/include/univ.i:528:54: note: expanded from macro 'UNIV_EXPECT'
# define UNIV_EXPECT(expr,constant) __builtin_expect(expr, constant)
                                                     ^~~~
/Users/count/scratch/percona-xtrabackup-2.4.9/storage/innobase/buf/buf0buf.cc:3940:25: error: member reference base type 'trx_rseg_t *' is not a structure or union
        buf_chunk_t* chunk = it->second;
                                ~~^ ~~~~~~
5 errors generated.
make[2]: *** [storage/innobase/CMakeFiles/innobase.dir/buf/buf0buf.cc.o] Error 1
make[1]: *** [storage/innobase/CMakeFiles/innobase.dir/all] Error 2
make: *** [all] Error 2

Revision history for this message
Sergei Glushchenko (sergei.glushchenko) wrote :

It is not new to 2.4.9. 2.4.8 has all the same issues. While OS X is not on the list of supported platforms, this issue actually exposes some bugs in MySQL server.

Here is the patch to fix the build:

diff --git i/sql/json_dom.h w/sql/json_dom.h
index 557eda617dc..545d31d5f97 100644
--- i/sql/json_dom.h
+++ w/sql/json_dom.h
@@ -368,7 +368,7 @@ struct Json_key_comparator
   Json_object class.
 */
 typedef std::map<std::string, Json_dom *, Json_key_comparator,
- Malloc_allocator<std::pair<std::string, Json_dom *> > > Json_object_map;
+ Malloc_allocator<std::pair<const std::string, Json_dom *> > > Json_object_map;

 /**
   Represents a JSON container value of type "object" (ECMA), type
diff --git i/storage/innobase/buf/buf0buf.cc w/storage/innobase/buf/buf0buf.cc
index b065ccff040..0f423d99e32 100644
--- i/storage/innobase/buf/buf0buf.cc
+++ w/storage/innobase/buf/buf0buf.cc
@@ -340,7 +340,7 @@ typedef std::map<
  const byte*,
  buf_chunk_t*,
  std::less<const byte*>,
- ut_allocator<std::pair<const byte*, buf_chunk_t*> > >
+ ut_allocator<std::pair<const byte* const, buf_chunk_t*> > >
  buf_pool_chunk_map_t;

 static buf_pool_chunk_map_t* buf_chunk_map_reg;
diff --git i/storage/innobase/dict/dict0stats.cc w/storage/innobase/dict/dict0stats.cc
index e3a9a6a5858..199d18cb713 100644
--- i/storage/innobase/dict/dict0stats.cc
+++ w/storage/innobase/dict/dict0stats.cc
@@ -139,7 +139,7 @@ then we would store 5,7,10,11,12 in the array. */
 typedef std::vector<ib_uint64_t, ut_allocator<ib_uint64_t> > boundaries_t;

 /** Allocator type used for index_map_t. */
-typedef ut_allocator<std::pair<const char*, dict_index_t*> >
+typedef ut_allocator<std::pair<const char* const, dict_index_t*> >
  index_map_t_allocator;

 /** Auxiliary map used for sorting indexes by name in dict_stats_save(). */
diff --git i/storage/innobase/sync/sync0debug.cc w/storage/innobase/sync/sync0debug.cc
index fc137ab5994..cbb4b2e8cd8 100644
--- i/storage/innobase/sync/sync0debug.cc
+++ w/storage/innobase/sync/sync0debug.cc
@@ -129,7 +129,7 @@ struct LatchDebug {
   os_thread_id_t,
   Latches*,
   os_thread_id_less,
- ut_allocator<std::pair<const std::string, latch_meta_t> > >
+ ut_allocator<std::pair<const os_thread_id_t, Latches*> > >
   ThreadMap;

  /** Constructor */
@@ -424,7 +424,7 @@ private:
   latch_level_t,
   std::string,
   latch_level_less,
- ut_allocator<std::pair<latch_level_t, std::string> > >
+ ut_allocator<std::pair<const latch_level_t, std::string> > >
   Levels;

  /** Mutex protecting the deadlock detector data structures. */
@@ -1718,7 +1718,7 @@ private:
   const void*,
   File,
   std::less<const void*>,
- ut_allocator<std::pair<const void*, File> > >
+ ut_allocator<std::pair<const void* const, File> > >
   Files;

  typedef OSMutex Mutex;

summary: - Version 2.4.9 doesn't compile on MacOS X anymore
+ Version 2.4 doesn't compile on MacOS X anymore
summary: - Version 2.4 doesn't compile on MacOS X anymore
+ xtrabackup 2.4.x doesn't compile on MacOS X anymore
Revision history for this message
Sergei Glushchenko (sergei.glushchenko) wrote :
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PXB-796

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.