This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug nptl/9804] pthread_exit from main thread: poor semantics, potential tty session lockup.
- From: "kkylheku at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 31 Jan 2009 03:29:37 -0000
- Subject: [Bug nptl/9804] pthread_exit from main thread: poor semantics, potential tty session lockup.
- References: <20090131031846.9804.kkylheku@gmail.com>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- Additional Comments From kkylheku at gmail dot com 2009-01-31 03:29 -------
(In reply to comment #0)
> The issue is that if the main thread of a process terminates with
> pthread_exit, while other threads are still running, the kernel task
> associated with the main thread becomes defunct in some kind of sleep that
> cannot be interrupted by an ordinary signal. As such, the kernel will not
> allow job control to be performed on that process. The process cannot be
> suspended with Ctrl-Z from the shell, nor can it be killed with Ctrl-C.
A little more precision is required. In fact, it's possible to kill the
process which is in this state with Ctrl-C. The trouble begins if a Ctrl-Z
suspend is attempted first. This is when it hangs.
The test case is simple: spawn a few threads which terminate after a timeout
of say 10 seconds, and have the main thread call pthread_exit(NULL). If you
run this process and do nothing, control is returned to the shell in about ten
seconds. If you kill it with Ctrl-C, control is regained immediately. If,
instead, you try to suspend it with Ctrl-Z, it hangs. The tasks of the other
threads terminate in ten seconds, but the main one must be killed by SIGKILL,
and control of the tty cannot be wrestled away from it.
--
http://sourceware.org/bugzilla/show_bug.cgi?id=9804
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.