Christian Seiler dixit: >If you have time, could you install gdb, compile the binary with
Well, I should have “lunch” (had breakfast at 12:30 this noon…), but this much I can do. >-g, and generate a backtrace? That might already help me to figure >out what's going on... Recursive calls; the SIGBUS is likely a stack underflow. GNU gdb (Debian 7.12-6) 7.12.0.20161007-git Copyright (C) 2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "aarch64-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from debian/unittests/ttt...done. (gdb) set pagination off (gdb) r Starting program: /home/tg/dietlibc-0.34~cvs20160606/debian/unittests/ttt [Inferior 1 (process 29556) exited normally] (gdb) r Starting program: /home/tg/dietlibc-0.34~cvs20160606/debian/unittests/ttt Program received signal SIGBUS, Bus error. 0x0000000000401740 in __testandset () (gdb) bt #0 0x0000000000401740 in __testandset () #1 0x00000000004016a0 in __pthread_lock () #2 0x00000000004016a0 in __pthread_lock () #3 0x00000000004016a0 in __pthread_lock () #4 0x00000000004016a0 in __pthread_lock () #5 0x00000000004016a0 in __pthread_lock () #6 0x00000000004016a0 in __pthread_lock () #7 0x00000000004016a0 in __pthread_lock () #8 0x00000000004016a0 in __pthread_lock () #9 0x00000000004016a0 in __pthread_lock () #10 0x00000000004016a0 in __pthread_lock () #11 0x00000000004016a0 in __pthread_lock () #12 0x00000000004016a0 in __pthread_lock () #13 0x00000000004016a0 in __pthread_lock () #14 0x00000000004016a0 in __pthread_lock () #15 0x00000000004016a0 in __pthread_lock () #16 0x00000000004016a0 in __pthread_lock () #17 0x00000000004016a0 in __pthread_lock () #18 0x00000000004016a0 in __pthread_lock () #19 0x00000000004016a0 in __pthread_lock () #20 0x00000000004016a0 in __pthread_lock () #21 0x00000000004016a0 in __pthread_lock () #22 0x00000000004016a0 in __pthread_lock () #23 0x00000000004016a0 in __pthread_lock () #24 0x00000000004016a0 in __pthread_lock () #25 0x00000000004016a0 in __pthread_lock () #26 0x00000000004016a0 in __pthread_lock () #27 0x00000000004016a0 in __pthread_lock () #28 0x00000000004016a0 in __pthread_lock () #29 0x00000000004016a0 in __pthread_lock () #30 0x00000000004016a0 in __pthread_lock () #31 0x00000000004016a0 in __pthread_lock () #32 0x00000000004016a0 in __pthread_lock () #33 0x00000000004016a0 in __pthread_lock () #34 0x00000000004016a0 in __pthread_lock () #35 0x00000000004016a0 in __pthread_lock () #36 0x00000000004016a0 in __pthread_lock () #37 0x00000000004016a0 in __pthread_lock () #38 0x00000000004016a0 in __pthread_lock () #39 0x00000000004016a0 in __pthread_lock () #40 0x00000000004016a0 in __pthread_lock () #41 0x00000000004016a0 in __pthread_lock () […] #11411 0x00000000004016a0 in __pthread_lock () #11412 0x00000000004016a0 in __pthread_lock () #11413 0x00000000004016a0 in __pthread_lock () #11414 0x00000000004016a0 in __pthread_lock () #11415 0x00000000004016a0 in __pthread_lock () […] But where’s the cause? I gave up around stack frame #25854 because I have another lead: (sid_arm64-dchroot)tg@asachi:~/dietlibc-0.34~cvs20160606$ gdb debian/unittests/ttt GNU gdb (Debian 7.12-6) 7.12.0.20161007-git Copyright (C) 2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "aarch64-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from debian/unittests/ttt...done. (gdb) b __pthread_lock Breakpoint 1 at 0x401674 (gdb) r Starting program: /home/tg/dietlibc-0.34~cvs20160606/debian/unittests/ttt Breakpoint 1, 0x0000000000401674 in __pthread_lock () (gdb) bt #0 0x0000000000401674 in __pthread_lock () #1 0x0000000000400858 in __thread_find_ () #2 0x0000000000400894 in __thread_self () #3 0x000000000040059c in malloc () #4 0x000000000040059c in malloc () #5 0x000000000040059c in malloc () #6 0x000000000040059c in malloc () #7 0x000000000040059c in malloc () […] A bit more digging: Your debian/patches/bugfixes/thread-self-vs-tcb.diff replaces the inline assembly implementation of __thread_self with one ending up recursively calling a chain malloc → __thread_self → __thread_find_ → __pthread_lock probably because it uses some structure that needs to be malloc(3)ed to work, but is needed for malloc(3) to function. libpthread/pthread_sys_alloc.c is highly involved. I hope this is a good lead for you… (at 22:17 nevertheless). bye, //mirabilos -- „Cool, /usr/share/doc/mksh/examples/uhr.gz ist ja ein Grund, mksh auf jedem System zu installieren.“ -- XTaran auf der OpenRheinRuhr, ganz begeistert (EN: “[…]uhr.gz is a reason to install mksh on every system.”)