From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19634 invoked by alias); 31 Jan 2009 03:29:46 -0000 Received: (qmail 19623 invoked by uid 48); 31 Jan 2009 03:29:37 -0000 Date: Sat, 31 Jan 2009 03:29:00 -0000 Message-ID: <20090131032937.19622.qmail@sourceware.org> From: "kkylheku at gmail dot com" To: glibc-bugs@sources.redhat.com In-Reply-To: <20090131031846.9804.kkylheku@gmail.com> References: <20090131031846.9804.kkylheku@gmail.com> Reply-To: sourceware-bugzilla@sourceware.org Subject: [Bug nptl/9804] pthread_exit from main thread: poor semantics, potential tty session lockup. X-Bugzilla-Reason: CC Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org X-SW-Source: 2009-01/txt/msg00149.txt.bz2 ------- 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.