This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug nptl/9804] pthread_exit from main thread: poor semantics, potential tty session lockup.


------- 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]