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

RE: zombie processes in openldap-1.0.3 shell backend



Hallvard B Furuseth wrote:
> >
> > Oh, BTW, there is a thread leak in servers/slapd/connection.c: The
> > threads createad by pthread_create() are never collected with
> > pthread_join().
>
Kurt D. Zeilenga writes:
> 
> POSIX 'detached' threads cannot be joined.  We likely
> should have lthread_join() which does the right thing
> based upon which threading environment we are runnning
> in if other threading environments require the join
> (likely if they don't support detachment).

This issue reared its head during our port to HP-UX 10.x. The only threads
package available to us on that platform is DCE threads provided natively
with the OS. However, the HP implementation does not provide support for all
of the POSIX calls (e.g., pthread_attr_setdetachstate()) as implemented in
the openLDAP source. Our solution involves "significant" (read "ugly")
#ifdef changes for HP to avoid these calls, substituting appropriate
pthread_detach()/pthread_join() calls. Similarly, the signal() usage in the
HP DCE threads environment is different than that which is implemented in
"other" environments (apparently), so significant changes were made there to
support graceful shutdown and on-demand thread switching (e.g., where a
write on a socket would block and control is given up to another thread).

To date, we have not attempted to register these changes back in the
mainstream openLDAP source tree, as we considered them so much a hack that
they would be unworthy of inclusion. Any work involving threading that could
eliminate these hacks would be welcomed. We're willing to share our
experience and limited knowledge with these issues to reach a common code
base solution.


Ken McGarrahan
Southwestern Bell Telephone

*	Phone: (314) 235-3160
*	E-Mail: km4155@sbc.com