mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Axel <Axel.Zeuner@gmx.de>
To: linux-kernel@vger.kernel.org, phil-list@redhat.com
Subject: 2.5.39: Signal delivery to thread groups: Bug or feature
Date: Sat, 28 Sep 2002 19:14:26 +0200	[thread overview]
Message-ID: <20020928165120Z262200-8740+2744@vger.kernel.org> (raw)

Hello, 
I played a little bit with the new clone flags and wrote a small test 
program using two threads: The first (initial) thread blocks all signals. The 
second thread is created with all signals blocked and inherits the signal 
mask of the initial thread. It unblocks SIGINT and calls sys_rt_sigtimedwait 
with the remaining signal mask. Therefore it waits for all signals with 
exception of SIGINT. In the kernel this yields to an empty signal mask for 
this thread during the sigwait. No signal handler is installed by the 
process. Now an external SIGINT is delivered to the whole process: The 
signal delivery code decides to send this signal directly to the initial thread 
because no user handler is installed and the signal mask for this thread 
blocks the signal. The second thread never receives the SIGINT.

Reason:
The main signal dispatching function send_sig_info in kernel/signal.c 
requires at the moment an installed signal handler for delivery of signals 
to members of the thread group.

Therefore NPTL/NPT must install signal handlers for all signals 
during startup to allow signal delivery to other threads and must restore
these default handlers to SIG_DFL after first delivery and raise
the signal to create the correct exit code.
IMHO, the current signal system is not a clean solution (yet), but of course
much better than the ugly signal forwarding required by the thread group 
leader only working as signal thread in 2.4.X. 

Axel




             reply	other threads:[~2002-09-28 16:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-28 17:14 Axel [this message]
2002-09-28 17:15 Axel
     [not found] <200209281638.g8SGcQi23877@mx1.redhat.com>
2002-09-29  8:25 ` Ingo Molnar
2002-09-29 16:56   ` Axel
2002-09-29 10:27 ` Ingo Molnar
2002-09-29 10:47   ` Roland McGrath

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=20020928165120Z262200-8740+2744@vger.kernel.org \
    --to=axel.zeuner@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=phil-list@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®