Bug 14038 - Fix compiling ctdb on older systems lacking POSIX robust mutexes
Fix compiling ctdb on older systems lacking POSIX robust mutexes
Status: RESOLVED FIXED
Product: Samba 4.1 and newer
Classification: Unclassified
Component: CTDB
unspecified
All All
: P5 normal
: ---
Assigned To: Karolin Seeger
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2019-07-12 09:00 UTC by Ralph Böhme
Modified: 2019-09-11 08:03 UTC (History)
1 user (show)

See Also:


Attachments
backport for 4.11 (2.20 KB, patch)
2019-09-04 10:05 UTC, Karolin Seeger
metze: review+
Details
backport for 4.10 (2.20 KB, patch)
2019-09-04 10:06 UTC, Karolin Seeger
metze: review+
Details
backport for 4.9 (2.20 KB, patch)
2019-09-04 10:08 UTC, Karolin Seeger
metze: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ralph Böhme 2019-07-12 09:00:00 UTC
On older systems like SLES 11 without POSIX robust mutexes, but with glib robust mutexes where all the functions are available but have a "_np" suffix, compilation fails in:

ctdb/tests/src/test_mutex_raw.c.239.o: In function `worker':
/root/samba-4.10.6/bin/default/../../ctdb/tests/src/test_mutex_raw.c:129: undefined reference to `pthread_mutex_consistent'
ctdb/tests/src/test_mutex_raw.c.239.o: In function `main':
/root/samba-4.10.6/bin/default/../../ctdb/tests/src/test_mutex_raw.c:285: undefined reference to `pthread_mutex_consistent'
/root/samba-4.10.6/bin/default/../../ctdb/tests/src/test_mutex_raw.c:332: undefined reference to `pthread_mutexattr_setrobust'
/root/samba-4.10.6/bin/default/../../ctdb/tests/src/test_mutex_raw.c:363: undefined reference to `pthread_mutex_consistent'
collect2: ld returned 1 exit status

This happens because our pthreads shim include isn't included but the systems pthread.h directly. libreplace system/threads.h provides the required define

#if defined(HAVE_PTHREAD_MUTEX_CONSISTENT_NP) && \
!defined(HAVE_PTHREAD_MUTEX_CONSISTENT)
#define pthread_mutex_consistent pthread_mutex_consistent_np
#endif
Comment 1 Martin Schwenke 2019-09-04 06:17:46 UTC
Do we want to backport commit f5388f97792ac2d7962950dad91aaf8ad49bceaa to any of the release branches?
Comment 2 Stefan Metzmacher 2019-09-04 09:54:14 UTC
(In reply to Martin Schwenke from comment #1)

I guess so...
Comment 3 Karolin Seeger 2019-09-04 10:05:05 UTC
Created attachment 15455 [details]
backport for 4.11
Comment 4 Karolin Seeger 2019-09-04 10:06:48 UTC
Created attachment 15456 [details]
backport for 4.10
Comment 5 Karolin Seeger 2019-09-04 10:08:20 UTC
Created attachment 15457 [details]
backport for 4.9
Comment 6 Stefan Metzmacher 2019-09-04 11:32:57 UTC
Comment on attachment 15457 [details]
backport for 4.9

Please add cherry-pick -x information before pushing...
Comment 7 Stefan Metzmacher 2019-09-04 11:33:14 UTC
Comment on attachment 15456 [details]
backport for 4.10

Please add cherry-pick -x information before pushing...
Comment 8 Stefan Metzmacher 2019-09-04 11:33:34 UTC
Comment on attachment 15455 [details]
backport for 4.11

Please add cherry-pick -x information before pushing...
Comment 9 Stefan Metzmacher 2019-09-04 11:34:07 UTC
Please add cherry-pick -x information before pushing...
Comment 10 Karolin Seeger 2019-09-10 07:54:08 UTC
Pushed to autobuild-v4-{11,10,9}-test.
Comment 11 Karolin Seeger 2019-09-11 08:03:24 UTC
(In reply to Karolin Seeger from comment #10)
Pushed to all branches.
Closing out bug report.

Thanks!