[MDEV-27876] Server building fails on MacOS caused by srw_lock_impl<false> template specialization Created: 2022-02-17  Updated: 2022-02-17  Resolved: 2022-02-17

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Affects Version/s: N/A
Fix Version/s: 10.9.0, 10.8.3

Type: Bug Priority: Major
Reporter: Dmitry Shulga Assignee: Marko Mäkelä
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Blocks
blocks MDEV-9180 Provide macOS packages for download a... Open
Problem/Incident
is caused by MDEV-27774 Reduce scalability bottlenecks in mtr... Closed

 Description   

[ 59%] Building CXX object storage/innobase/CMakeFiles/innobase.dir/btr/btr0btr.cc.o
In file included from server-10.9/storage/innobase/btr/btr0btr.cc:28:
In file included from server-10.9/storage/innobase/include/btr0btr.h:31:
In file included from server-10.9/storage/innobase/include/dict0dict.h:32:
In file included from server-10.9/storage/innobase/include/dict0mem.h:45:
In file included from server-10.9/storage/innobase/include/buf0buf.h:33:
In file included from server-10.9/storage/innobase/include/fil0fil.h:39:
In file included from server-10.9/storage/innobase/include/log0recv.h:31:
server-10.9/storage/innobase/include/log0log.h:324:17: error: no member named 'is_write_locked' in 'srw_lock_impl<false>'
    ut_ad(latch.is_write_locked());
          ~~~~~ ^
server-10.9/storage/innobase/include/ut0dbg.h:62:15: note: expanded from macro 'ut_ad'
#define ut_ad   DBUG_SLOW_ASSERT
                ^
server-10.9/include/my_dbug.h:122:41: note: expanded from macro 'DBUG_SLOW_ASSERT'
#define DBUG_SLOW_ASSERT(A) DBUG_ASSERT(A)
                                        ^
server-10.9/include/my_dbug.h:120:18: note: expanded from macro 'DBUG_ASSERT'
  if (unlikely(!(A)) && _db_my_assert(__FILE__, __LINE__, #A)) assert(A); \
                 ^
server-10.9/include/my_global.h:372:40: note: expanded from macro 'unlikely'
#define unlikely(x)     __builtin_expect(((x) != 0),0)
                                           ^
In file included from server-10.9/storage/innobase/btr/btr0btr.cc:28:
In file included from server-10.9/storage/innobase/include/btr0btr.h:31:
In file included from server-10.9/storage/innobase/include/dict0dict.h:32:
In file included from server-10.9/storage/innobase/include/dict0mem.h:45:
In file included from server-10.9/storage/innobase/include/buf0buf.h:33:
In file included from server-10.9/storage/innobase/include/fil0fil.h:39:
In file included from server-10.9/storage/innobase/include/log0recv.h:31:
server-10.9/storage/innobase/include/log0log.h:324:17: error: no member named 'is_write_locked' in 'srw_lock_impl<false>'
    ut_ad(latch.is_write_locked());
          ~~~~~ ^
server-10.9/storage/innobase/include/ut0dbg.h:62:15: note: expanded from macro 'ut_ad'
#define ut_ad   DBUG_SLOW_ASSERT
                ^
server-10.9/include/my_dbug.h:122:41: note: expanded from macro 'DBUG_SLOW_ASSERT'
#define DBUG_SLOW_ASSERT(A) DBUG_ASSERT(A)
                                        ^
server-10.9/include/my_dbug.h:120:71: note: expanded from macro 'DBUG_ASSERT'
  if (unlikely(!(A)) && _db_my_assert(__FILE__, __LINE__, #A)) assert(A); \
                                                                      ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/assert.h:99:25: note: expanded from macro 'assert'
    (__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __ASSERT_FILE_NAME, __LINE__, #e) : (void)0)
                        ^
In file included from server-10.9/storage/innobase/btr/btr0btr.cc:28:
In file included from server-10.9/storage/innobase/include/btr0btr.h:31:
In file included from server-10.9/storage/innobase/include/dict0dict.h:32:
In file included from server-10.9/storage/innobase/include/dict0mem.h:45:
In file included from server-10.9/storage/innobase/include/buf0buf.h:33:
In file included from server-10.9/storage/innobase/include/fil0fil.h:39:
In file included from server-10.9/storage/innobase/include/log0recv.h:31:
server-10.9/storage/innobase/include/log0log.h:383:17: error: no member named 'is_locked' in 'srw_lock_impl<false>'
    ut_ad(latch.is_locked());
          ~~~~~ ^
server-10.9/storage/innobase/include/ut0dbg.h:62:15: note: expanded from macro 'ut_ad'
#define ut_ad   DBUG_SLOW_ASSERT
                ^
server-10.9/include/my_dbug.h:122:41: note: expanded from macro 'DBUG_SLOW_ASSERT'
#define DBUG_SLOW_ASSERT(A) DBUG_ASSERT(A)
                                        ^
server-10.9/include/my_dbug.h:120:18: note: expanded from macro 'DBUG_ASSERT'
  if (unlikely(!(A)) && _db_my_assert(__FILE__, __LINE__, #A)) assert(A); \
                 ^
server-10.9/include/my_global.h:372:40: note: expanded from macro 'unlikely'
#define unlikely(x)     __builtin_expect(((x) != 0),0)
                                           ^
In file included from server-10.9/storage/innobase/btr/btr0btr.cc:28:
In file included from server-10.9/storage/innobase/include/btr0btr.h:31:
In file included from server-10.9/storage/innobase/include/dict0dict.h:32:
In file included from server-10.9/storage/innobase/include/dict0mem.h:45:
In file included from server-10.9/storage/innobase/include/buf0buf.h:33:
In file included from server-10.9/storage/innobase/include/fil0fil.h:39:
In file included from server-10.9/storage/innobase/include/log0recv.h:31:
server-10.9/storage/innobase/include/log0log.h:383:17: error: no member named 'is_locked' in 'srw_lock_impl<false>'
    ut_ad(latch.is_locked());
          ~~~~~ ^
server-10.9/storage/innobase/include/ut0dbg.h:62:15: note: expanded from macro 'ut_ad'
#define ut_ad   DBUG_SLOW_ASSERT
                ^
server-10.9/include/my_dbug.h:122:41: note: expanded from macro 'DBUG_SLOW_ASSERT'
#define DBUG_SLOW_ASSERT(A) DBUG_ASSERT(A)
                                        ^
server-10.9/include/my_dbug.h:120:71: note: expanded from macro 'DBUG_ASSERT'
  if (unlikely(!(A)) && _db_my_assert(__FILE__, __LINE__, #A)) assert(A); \
                                                                      ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/assert.h:99:25: note: expanded from macro 'assert'
    (__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __ASSERT_FILE_NAME, __LINE__, #e) : (void)0)
                        ^
4 errors generated.



 Comments   
Comment by Marko Mäkelä [ 2022-02-17 ]

I can repeat this with the following:

diff --git a/storage/innobase/include/rw_lock.h b/storage/innobase/include/rw_lock.h
index a9099d10670..ead936258ae 100644
--- a/storage/innobase/include/rw_lock.h
+++ b/storage/innobase/include/rw_lock.h
@@ -22,7 +22,7 @@ this program; if not, write to the Free Software Foundation, Inc.,
 
 #if !(defined __linux__ || defined __OpenBSD__ || defined _WIN32)
 # define SUX_LOCK_GENERIC
-#elif 0 // defined SAFE_MUTEX
+#elif 1 // defined SAFE_MUTEX
 # define SUX_LOCK_GENERIC /* Use dummy implementation for debugging purposes */
 #endif
 

Such a predicate is only available for the latch implementations based on a futex system call, or the Microsoft Windows SRWLOCK.

Generated at Thu Feb 08 09:56:15 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.