[Date Prev][Date Next] [Chronological] [Thread] [Top]

GNU Pth initialized too late causing segfault (ITS#3344)



Full_Name: Thomas Lotterer
Version: 2.2.17
OS: FreeBSD, Linux, Solaris
URL: http://cvs.openpkg.org/chngview?cn=19165
Submission from: (NULL) (62.245.163.160)


When building with GNU Pth support the threading environment is initialized too
late causing sldapd segfaulting on the first ldap_...() function call. The
required GNU Pth call is pth_init() which is indirectly called by
ldap_pvt_thread_initialize.

So my solution was to call ldap_pvt_thread_initialize() at an earlier stage. It
does no harm leaving the original late call as a dup because the function
protects itself against multiple calls. See attached URL. I'm unsure whether my
patch can be taken over verbatim as I did not test it under non-Unix and
non-Pth. However, I did some stress testing on FreeBSD 4.10, Debian 3.1 "Sarge"
Linux and Solaris 9 (sparc).