mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Roland McGrath <roland@redhat.com>
To: Oleg Nesterov <oleg@redhat.com>
Cc: Kaz Kylheku <kkylheku@gmail.com>,
	linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Ulrich Drepper <drepper@redhat.com>
Subject: Re: main thread pthread_exit/sys_exit bug!
Date: Wed,  4 Feb 2009 19:05:53 -0800 (PST)	[thread overview]
Message-ID: <20090205030553.49650FC381@magilla.sf.frob.com> (raw)
In-Reply-To: Oleg Nesterov's message of  Monday, 2 February 2009 17:56:06 +0100 <20090202165606.GA13346@redhat.com>

I haven't seen the clear explanation of what specific actual problems there
are here.  But I'm quite sure this is not the right approach to address them.

Kaz has said things that seemed to imply that the behavior is erratic or
the semantics are somehow ill-defined when the group leader has died with
other threads living on.  In fact, this case is perfectly well-specified
and there is no mystery about it.

The group leader dies and becomes a zombie.  The zombie group leader is
kept from reaping and parent notification by the delayed_group_leader()
logic and related code, until the last thread in the group dies.  The tgid
(leader's tid), aka PID in POSIX terms, remains as the PID for the process
as a whole and signals to it work fine, etc.

Quite some time ago, there was some /proc bug wherein /proc/pid/task could
not be listed when the group leader had died.  That prevented strace or gdb
from attaching to the process after its initial thread used pthread_exit.
I don't recall when that was fixed, but it's been fine for a good while.
That is the only problem for debuggability of this case that I recall
knowing about.

Certainly long ago there were many problems with job control signals in
multi-thread groups, and there have been many little corner cases fixed in
that over the 2.6.x period.  I'm not aware of any such problems remaining.
But if there are some, they need to be fixed in the signals code.  It's
certainly clear how it's supposed to work, and that's no different when the
group leader is dead.


Thanks,
Roland

  parent reply	other threads:[~2009-02-05  3:31 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-01 22:32 Kaz Kylheku
     [not found] ` <20090201174159.4a52e15c.akpm@linux-foundation.org>
2009-02-02  6:45   ` Oleg Nesterov
2009-02-02  7:10     ` Kaz Kylheku
2009-02-02 16:56       ` Oleg Nesterov
2009-02-02 20:10         ` Kaz Kylheku
2009-02-02 20:17         ` Ulrich Drepper
2009-02-02 20:39           ` Kaz Kylheku
2009-02-03  2:39             ` Kaz Kylheku
2009-02-03 13:33               ` Oleg Nesterov
2009-02-03 19:51                 ` Kaz Kylheku
2009-02-03 21:32                   ` Oleg Nesterov
2009-02-03 23:06                     ` Kaz Kylheku
2009-02-05  3:05         ` Roland McGrath [this message]
2009-02-05  4:55           ` Kaz Kylheku
2009-02-05 16:15             ` Oleg Nesterov
2009-02-05 21:22               ` Roland McGrath
2009-02-05 23:22                 ` Oleg Nesterov
2009-02-09  3:33                   ` Roland McGrath
2009-02-09  4:52                     ` Oleg Nesterov
2009-02-09  5:14                       ` Oleg Nesterov

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=20090205030553.49650FC381@magilla.sf.frob.com \
    --to=roland@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=drepper@redhat.com \
    --cc=kkylheku@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg@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

all inboxes | Powered by JetHome®