This is the mail archive of the
libc-alpha@sources.redhat.com
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%IBMU <Khoa_Huynh/Austin/IBM%IBMU at in dot ibm dot com>
- Date: Thu, 13 Dec 2001 12:37:00 +0000
- Subject: Re: Thread exit leaves zombies ...................
Hi,
I have gone through your following mail. Actually before coding that patch
, I varified the man pages of
sigprocmask( ) , it doesn't say that it can not be called from
multi-threaded application.May be this information
is there in pthread document. I never varified the pthread document.
Now let me your suggestion regarding this test case/problem ?
we need to change the signal handling in kernel ?
Expecting a reply soon.
Thanks
Manoj Nayak
Ulrich Drepper
<drepper@redha To: Manoj Nayak/India/IBM@IBMIN
t.com> cc: libc-alpha@sources.redhat.com, Khoa
Sent by: Huynh/Austin/IBM@IBMUS
drepper@myware Subject: Re: Thread exit leaves zombies
.mynet ...................
12/13/2001
12:03 AM
Please respond
to drepper
"Manoj Nayak" <mnayak@in.ibm.com> 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
not sufficient.
--
---------------. ,-. 1325 Chesapeake Terrace
Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA
Red Hat `--' drepper at redhat.com `------------------------