public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "kkylheku at gmail dot com" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sources.redhat.com
Subject: [Bug nptl/9804] pthread_exit from main thread: poor semantics, potential tty session lockup.
Date: Sat, 31 Jan 2009 03:29:00 -0000	[thread overview]
Message-ID: <20090131032937.19622.qmail@sourceware.org> (raw)
In-Reply-To: <20090131031846.9804.kkylheku@gmail.com>


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


  reply	other threads:[~2009-01-31  3:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-31  3:18 [Bug nptl/9804] New: " kkylheku at gmail dot com
2009-01-31  3:29 ` kkylheku at gmail dot com [this message]
2009-01-31  7:02 ` [Bug nptl/9804] " kkylheku at gmail dot com
2009-01-31  7:43 ` kkylheku at gmail dot com
2009-02-01 21:14 ` kkylheku at gmail dot com
2009-02-01 22:10 ` kkylheku at gmail dot com
2009-02-03  2:30 ` kkylheku at gmail dot com
     [not found] <bug-9804-131@http.sourceware.org/bugzilla/>
2014-07-01 21:00 ` fweimer at redhat dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090131032937.19622.qmail@sourceware.org \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).