[MDEV-30811] Build issues on macOS 11.0 Created: 2023-03-08  Updated: 2023-03-16  Resolved: 2023-03-16

Status: Closed
Project: MariaDB Server
Component/s: Compiling
Affects Version/s: 11.0
Fix Version/s: 11.0.2

Type: Bug Priority: Major
Reporter: Weijun Huang Assignee: Dmitry Shulga
Resolution: Fixed Votes: 0
Labels: None
Environment:

macOS Monterey, 12.5.1, ARM architecture, clang version 15.0.3



 Description   

Failed to compile 11.0 on MacOS. The bug happened after 95d51369c9b1d5b759be630003ab12e9615ea0cc. It was caused by 7a834d6248f42bd2207152071d31e9ecfc5de422 commit.

Run the following to compile

cmake ../MariaDB_server -DCMAKE_BUILD_TYPE=Debug -DMYSQL_MAINTAINER_MODE=OFF
cmake --build . --parallel 20

Met the error

[ 38%] Built target udf_example
Creating mysqld_safe_helper link
[ 38%] Built target mariadbd-safe-helper
[ 38%] Built target mariadb-conv
[ 38%] Linking CXX executable ed25519-t
[ 38%] Linking CXX executable aes-t
/bin/sh: line 1: 57806 Abort trap: 6           ./comp_err --charset=/Users/huangweijun/Desktop/MariaDB/MariaDB_server/sql/share/charsets --out-dir=/Users/huangweijun/Desktop/MariaDB/build/sql/share/ --header_file=/Users/huangweijun/Desktop/MariaDB/build/include/mysqld_error.h.tmp --name_file=/Users/huangweijun/Desktop/MariaDB/build/include/mysqld_ername.h.tmp --state_file=/Users/huangweijun/Desktop/MariaDB/build/include/sql_state.h.tmp --in_file=/Users/huangweijun/Desktop/MariaDB/MariaDB_server/sql/share/errmsg-utf8.txt
make[2]: *** [include/mysqld_error.h.tmp] Error 134
make[1]: *** [extra/CMakeFiles/GenError.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
/bin/sh: line 1: 57874 Abort trap: 6           ./factorial 1 2 3 4 5 > output1.r
make[2]: *** [dbug/output1.r] Error 134
make[2]: *** Deleting file `dbug/output1.r'
make[1]: *** [dbug/CMakeFiles/user_t.dir/all] Error 2
[ 38%] Built target ed25519-t
/bin/sh: line 1: 57891 Abort trap: 6           ./factorial 1 2 3 4 5 > output1.r
make[2]: *** [dbug/output1.r] Error 134
make[1]: *** [dbug/CMakeFiles/user_ps.dir/all] Error 2
[ 38%] Built target aes-t
[ 38%] Linking CXX executable mariadb-tzinfo-to-sql
Creating mysql_tzinfo_to_sql link
[ 38%] Built target mariadb-tzinfo-to-sql
/Users/huangweijun/Desktop/MariaDB/build/sql/yy_mariadb.cc:35600: warning: suspicious sequence in the output: b4_bin [-Wother]
[ 38%] Building CXX object sql/CMakeFiles/gen_lex_token.dir/gen_lex_token.cc.o
[ 38%] Linking CXX executable gen_lex_token
[ 38%] Built target gen_lex_token
make: *** [all] Error 2

Debug into it

(lldb) target create "./factorial"
Current executable set to '/Users/huangweijun/Desktop/MariaDB/build/dbug/factorial' (arm64).
(lldb) settings set -- target.run-args  "1" "2" "3" "4" "5"
(lldb) r
Process 85285 launched: '/Users/huangweijun/Desktop/MariaDB/build/dbug/factorial' (arm64)
Process 85285 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
    frame #0: 0x000000018708f4d4 libsystem_kernel.dylib`__abort_with_payload + 8
libsystem_kernel.dylib`:
->  0x18708f4d4 <+8>:  b.lo   0x18708f4f4               ; <+40>
    0x18708f4d8 <+12>: pacibsp
    0x18708f4dc <+16>: stp    x29, x30, [sp, #-0x10]!
    0x18708f4e0 <+20>: mov    x29, sp
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
  * frame #0: 0x000000018708f4d4 libsystem_kernel.dylib`__abort_with_payload + 8
    frame #1: 0x0000000187091ecc libsystem_kernel.dylib`abort_with_payload_wrapper_internal + 104
    frame #2: 0x0000000187091e64 libsystem_kernel.dylib`abort_with_reason + 32
    frame #3: 0x00000001870a4878 libsystem_pthread.dylib`pthread_self.cold.1 + 36
    frame #4: 0x000000018709baac libsystem_pthread.dylib`pthread_self + 80
    frame #5: 0x0000000100019fa0 factorial`my_thread_init at my_thr_init.c:296:22
    frame #6: 0x0000000100019ef8 factorial`my_thread_global_init at my_thr_init.c:186:7
    frame #7: 0x0000000100015df0 factorial`my_init at my_init.c:204:7
    frame #8: 0x0000000100003b4c factorial`main(argc=6, argv=0x000000016fdfee40) at my_main.c:14:3
    frame #9: 0x00000001004ed08c dyld`start + 520
 
(lldb) x/8i 0x18708f4cc
    0x18708f4cc: 0xd2804130   unknown     mov    x16, #0x209
    0x18708f4d0: 0xd4001001   unknown     svc    #0x80
->  0x18708f4d4: 0x54000103   unknown     b.lo   0x18708f4f4               ; <+40>
    0x18708f4d8: 0xd503237f   unknown     pacibsp
    0x18708f4dc: 0xa9bf7bfd   unknown     stp    x29, x30, [sp, #-0x10]!
    0x18708f4e0: 0x910003fd   unknown     mov    x29, sp
    0x18708f4e4: 0x97ff4fd3   unknown     bl     0x187063430               ; cerror_nocancel
    0x18708f4e8: 0x910003bf   unknown     mov    sp, x29



 Comments   
Comment by Daniel Black [ 2023-03-09 ]

is an assertion cause followable for the pthread library version from https://opensource.apple.com/source/libpthread/libpthread-454.80.2/src/pthread_tsd.c.auto.html (pthread_self at bottom of page).

Comment by Dmitry Shulga [ 2023-03-16 ]

The branch for review is bb-11.0-MDEV-30811

Comment by Sergei Golubchik [ 2023-03-16 ]

ok to push. but please make my_symlink.c to look like it was before my fix. That is,

  if ((length=readlink(filename, to, FN_REFLEN-1)) < 0)
  {
    /* Don't give an error if this wasn't a symlink */
    if ((my_errno=errno) == EINVAL)
    {
      result= 1;

Generated at Thu Feb 08 10:19:04 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.