[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Re: zombie processes in openldap-1.0.3 shell backend
Kurt D. Zeilenga writes:
> I suspect this code is buggy. Besides the wait() issue, it has
> a few other problems. First off, fork() in threaded environments
> and doing anything other than exec() is a bad idea (including calling
> close()).
I'm not about to mess with thread stuff myself, but I imagine
switch ( (pid = fork()) ) {
in servers/slapd/back-shell/fork.c should be
#if HAVE_THR
pid = fork1();
#else
pid = fork();
#endif
switch ( pid ) {
similar to what liblutil/detach.c, since fork() with HAVE_THR copies all
the threads instead of just the thread doing fork().
Oh, BTW, there is a thread leak in servers/slapd/connection.c: The
threads createad by pthread_create() are never collected with
pthread_join().
--
Hallvard