This is due to a bug related to robust mutex scheduling in Linux/glibc.
This bug has been reported to redhat bugzilla. https://bugzilla.redhat.com/show_bug.cgi?id=1401665
Created attachment 12830 [details] Patches for v4-6
Created attachment 12831 [details] Patches for v4-5
Hi Karolin, This is ready for 4.5 and 4.6. Thanks...
(In reply to Martin Schwenke from comment #4) Pushed to autobuild-v4-{6,5}-test.
(In reply to Karolin Seeger from comment #5) Pushed to both branches. Closing out bug report. Thanks!
Patch seems to brake build on e.g. SUSE 11.1: [2788/3997] Compiling ctdb/tests/src/test_mutex_raw.c ../ctdb/tests/src/test_mutex_raw.c: In function 'main': ../ctdb/tests/src/test_mutex_raw.c:205: error: 'PTHREAD_MUTEX_ROBUST' undeclared (first use in this function) ../ctdb/tests/src/test_mutex_raw.c:205: error: (Each undeclared identifier is reported only once ../ctdb/tests/src/test_mutex_raw.c:205: error: for each function it appears in.) Waf: Leaving directory `/root/build/4.5.5-13/BUILD/samba-4.5.5/bin' Build failed: -> task failed (err #1): {task: cc test_mutex_raw.c -> test_mutex_raw_110.o} make: *** [all] Error 1
Created attachment 12866 [details] skip build of test_mutex_raw if robust mutexes are not available With the attached patch waf skips the build of the test if robust mutexes are not available.
(In reply to Björn Baumbach from comment #8) Hi Björn, can you change this pass enabled=bld.env.HAVE_ROBUST_MUTEXES to bld.SAMBA_BINARY() ? Thanks! metze
Comment on attachment 12866 [details] skip build of test_mutex_raw if robust mutexes are not available Does not work, sorry.
(In reply to Björn Baumbach from comment #10) Why does the patch not work?
Created attachment 12870 [details] Extra patches for master
Hi Karolin, Can you check if the extra patches fix the issue?
(In reply to Amitay Isaacs from comment #13) The test should use the following includes #include "replace.h" #include "system/filesys.h" #include "system/wait.h" #include "system/threads.h" and don't use the _np() functions directly.
Created attachment 12874 [details] Extra patches for master
(In reply to Stefan Metzmacher from comment #14) Yes, I wrote this code for standalone testing. I see that system/threads.h takes care of defining PTHREAD_MUTEX_ROBUST and pthread_mutexattr_setrobust(). I have updated the patches.
(In reply to Amitay Isaacs from comment #16) You should also remove the pthread_mutex_consistent_np() prototype and use pthread_mutex_consistent() instead.
Created attachment 12879 [details] Extra patches for master
(In reply to Stefan Metzmacher from comment #17) Done.
(In reply to Amitay Isaacs from comment #19) Thanks! Pushed to autobuild.
Created attachment 12892 [details] Extra patches for v4-6
Created attachment 12893 [details] Extra patches for v4-5
Karolin, The extra patches should fix the build on suse 11.1 or any other older glibc distro. They are ready for 4.5 and 4.6.
(In reply to Amitay Isaacs from comment #23) Pushed to autobuild-v4-{5,6}-test.
(In reply to Karolin Seeger from comment #24) Pushed to both branches. Closing out bug report. Thanks!