This is the mail archive of the
mailing list for the glibc project.
Re: Thread exit leaves zombies ...................
- From: "Manoj Nayak" <mnayak at in dot ibm dot com>
- To: drepper at redhat dot com (Ulrich Drepper)
- Cc: libc-alpha at sources dot redhat dot com, Khoa_Huynh/Austin/IBM%IBMUS <khoa at us dot ibm dot com>
- Date: Fri, 4 Jan 2002 10:16:00 +0000
- Subject: Re: Thread exit leaves zombies ...................
As per your suggestion , I am not using sigprocmask( ) in my test case , as
you said the use of sigprocmask()
is undefined in multi-threaded program.Instead of sigprocmask() , I am
using pthread_sigmask ( ) , however
I am still getting the bug . (pthread_sigmask ( ) can be used in
multi-threaded programming ).
Can you suggest something regarding the failure of pthread_sigmask ( ) in
my test case.
Expecting a reply.
Thanks & Regards
<drepper@redha To: Manoj Nayak/India/IBM@IBMIN
t.com> cc: email@example.com, Khoa
Sent by: Huynh/Austin/IBM@IBMUS
drepper@myware Subject: Re: Thread exit leaves zombies
"Manoj Nayak" <firstname.lastname@example.org> writes:
> After sending signal to child threads & main thread ,manager thread
> dies .However main thread is not killed in response to manager
> thread's signal as it has already blocked that signal & at the same
> time main thread is not waiting ( in a waitpid() call ) for manager
> thread to free any system resource used by manager thread. That's
> why manager thread becomes zombie.
> This is rectified by passing __pthread_sig_cancel as one of flags to
> clone () system call.
Your expectations are wrong. And the test program, btw: you are not
allowed to use sigprocmask() in multi-threaded applications.
The Unix/POSIX standard says:
When a signal is delivered to a thread, if the action of that signal
specifies termination, stop, or continue, the entire process shall
be terminated, stopped, or continued, respectively.
I.e., blocking signal 2 in one thread must not prevent the thread from
being killed if any other thread accepts the signal with the
termination action and gets such a signal delivered.
This does not mean the current implementation is correct. It isn't.
But your patch isn't doing to right thing. I see no possibility to
fix this in the moment. The signal handling the kernel implements is
---------------. ,-. 1325 Chesapeake Terrace
Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA
Red Hat `--' drepper at redhat.com `------------------------