[MDEV-27222] FreeBSD 13.0-p4 build error mariadb-10.6.5 Created: 2021-12-10  Updated: 2022-02-28  Resolved: 2022-02-27

Status: Closed
Project: MariaDB Server
Component/s: Compiling, Storage Engine - InnoDB
Affects Version/s: 10.6.5
Fix Version/s: 10.6.7

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

System: FreeBSD 13.0-p4
Compiler: clang 11.0.1 with cmake 3.22.0 and bison 3.8.2
Use Patch: https://jira.mariadb.org/browse/MDEV-20248
Build: cmake -DWITHOUT_TOKUDB=1 -DWITHOUT_MROONGA=1 ..


Issue Links:
Relates
relates to MDEV-26476 InnoDB is missing futex support on so... Closed
relates to MDEV-26769 InnoDB internal latches do not suppor... Closed

 Description   

System: FreeBSD 13.0-p4
Compiler: clang 11.0.1 with cmake 3.22.0 and bison 3.8.2
Use Patch: MDEV-20248
Build: cmake -DWITHOUT_TOKUDB=1 -DWITHOUT_MROONGA=1 ..

make error

[ 50%] Building C object storage/heap/CMakeFiles/heap.dir/hp_write.c.o
[ 50%] Linking CXX static library libheap.a
[ 50%] Built target heap
[ 50%] Building CXX object storage/innobase/CMakeFiles/innobase.dir/btr/btr0btr.cc.o
In file included from /usr/local/src/mariadb-10.6.5/storage/innobase/btr/btr0btr.cc:28:
In file included from /usr/local/src/mariadb-10.6.5/storage/innobase/include/btr0btr.h:31:
In file included from /usr/local/src/mariadb-10.6.5/storage/innobase/include/dict0dict.h:32:
In file included from /usr/local/src/mariadb-10.6.5/storage/innobase/include/dict0mem.h:45:
In file included from /usr/local/src/mariadb-10.6.5/storage/innobase/include/buf0buf.h:43:
/usr/local/src/mariadb-10.6.5/storage/innobase/include/transactional_lock_guard.h:145:14: error: 'is_write_locked' is a private member of 'rw_lock'
      if (!m.is_write_locked())
             ^
/usr/local/src/mariadb-10.6.5/storage/innobase/include/buf0buf.h:1540:54: note: in instantiation of member function 'transactional_shared_lock_guard<page_hash_latch>::transactional_shared_lock_guard' requested here
    transactional_shared_lock_guard<page_hash_latch> g
                                                     ^
/usr/local/src/mariadb-10.6.5/storage/innobase/include/buf0types.h:182:25: note: constrained by private inheritance here
class page_hash_latch : private rw_lock
                        ^~~~~~~~~~~~~~~
/usr/local/src/mariadb-10.6.5/storage/innobase/include/rw_lock.h:225:8: note: member is declared here
  bool is_write_locked() const { return !!(value() & WRITER); }
       ^
In file included from /usr/local/src/mariadb-10.6.5/storage/innobase/btr/btr0btr.cc:28:
In file included from /usr/local/src/mariadb-10.6.5/storage/innobase/include/btr0btr.h:31:
In file included from /usr/local/src/mariadb-10.6.5/storage/innobase/include/dict0dict.h:32:
In file included from /usr/local/src/mariadb-10.6.5/storage/innobase/include/dict0mem.h:45:
In file included from /usr/local/src/mariadb-10.6.5/storage/innobase/include/buf0buf.h:43:
/usr/local/src/mariadb-10.6.5/storage/innobase/include/transactional_lock_guard.h:145:12: error: cannot cast 'page_hash_latch' to its private base class 'const rw_lock'
      if (!m.is_write_locked())
           ^
/usr/local/src/mariadb-10.6.5/storage/innobase/include/buf0types.h:182:25: note: declared private here
class page_hash_latch : private rw_lock
                        ^~~~~~~~~~~~~~~
2 errors generated.
*** Error code 1
 
Stop.
make[2]: stopped in /usr/local/src/mariadb-10.6.5/build
*** Error code 1
 
Stop.
make[1]: stopped in /usr/local/src/mariadb-10.6.5/build
*** Error code 1
 
Stop.
make: stopped in /usr/local/src/mariadb-10.6.5/build

The "transactional_lock_guard.h" comes with commit "1f02280904fcfbb2bd86404d1c85c025634f8c9d" but compile mariadb-10.6.4 works.



 Comments   
Comment by Sebastian [ 2021-12-23 ]

A working workaround is to change the following line in "buf0types.h" under subfolder "/storage/innobase/include/"

--- storage/innobase/include/buf0types.h.orig	2021-12-23 18:21:43.106905000 +0100
+++ storage/innobase/include/buf0types.h	2021-12-23 18:22:43.743643000 +0100
@@ -191,7 +191,7 @@
   /** Acquire an exclusive lock */
   inline void lock();
 
-#ifdef UNIV_DEBUG
+#if defined(UNIV_DEBUG) || defined(__FreeBSD__)
   /** @return whether an exclusive lock is being held by any thread */
   bool is_write_locked() const { return rw_lock::is_write_locked(); }
 #endif

Comment by Sebastian [ 2022-02-26 ]

The problem is fixed with version 10.6.7 but I don't know the commit or pull-request for the solution.
But you can close the problem. Thanks.

Comment by Sergei Golubchik [ 2022-02-27 ]

Thanks, closing.

Comment by Marko Mäkelä [ 2022-02-28 ]

This was probably broken in MDEV-26769 and fixed in this follow-up change.

Starting with MariaDB Server 10.6.8, InnoDB will use a futex-like interface not only on Linux, Microsoft Windows, OpenBSD, but also on FreeBSD and DragonFly BSD (MDEV-26476).

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