This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: Thread exit leaves zombies ...................
- From: Ulrich Drepper <drepper at redhat dot com>
- To: "Manoj Nayak" <mnayak at in dot ibm dot com>
- Cc: libc-alpha at sources dot redhat dot com, khoa at us dot ibm dot com
- Date: 12 Dec 2001 16:03:24 -0800
- Subject: Re: Thread exit leaves zombies ...................
- References: <OFE32CBC26.508E33B4-ON65256B11.00497E1A@in.ibm.com>
- Reply-to: drepper at redhat dot com (Ulrich 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 `------------------------