fork() after pthread_mutex_init()

Alan DeKok aland at deployingradius.com
Wed May 15 15:33:06 CEST 2013


Edgar Fuß wrote:
> Just for the sake of the archives: This turned out NOT to be a FreeRADIUS bug.

  That's nice.

> After a lot of debugging, it turned out that radiusd, via initgroups() and nsswitch.conf, loaded nss_ldap, which pulled in libldap (the non-reentrant version). Also, radiusd, via rlm_ldap, pulled in libldap_r (the reentrant version). However, nss_ldap had registered a pthread_atfork handler, which intended to call ldap_drop_conenction() from libldap, but, because of PLT load-time-linking, in fact ended up calling ldap_drop_connection() from libldap_r. Boom (inside fork()).

  Ah.  The simple answer is "don't do that".  Having layers of competing
library dependencies is wrong.

  Alan DeKok.


More information about the Freeradius-Devel mailing list