Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@mvista.com>
To: gdb@sources.redhat.com
Cc: mingo@redhat.com, roland@redhat.com
Subject: FYI: Increase in schedlock.exp failures in LinuxThreads on an RH kernel
Date: Sun, 27 Jul 2003 16:17:00 -0000	[thread overview]
Message-ID: <20030727161737.GA23676@nevyn.them.org> (raw)

I noticed recently, after switching kernels (I'm temporarily running a
Debian system with a Red Hat kernel - don't ask) that schedlock.exp took a
rapid spike up in failures.  I investigated; the problem appears to be
SIGINT handling.  When the test sends a control-C, it is delivered to some
arbitrary portion of the (non-manager; this is LinuxThreads) threads.  Then,
when we next resume, the remaining threads receive it.

I think this is an old problem, just being exposed by timing.  The flush
mask in stop_wait_callback is supposed to handle this.  But since some of
the extra SIGINT signals arrive after the SIGSTOP, we can't flush them. 
This won't happen in NPTL, of course, where just one thread will get the
SIGINT.

I tried something terribly clever involving looking at the SigPnd mask in
/proc to see if a SIGINT was pending.  However, unfortunately, this kernel
(looks like... 2.4.20-18.9) introduced the shared pending queue, but did not
add ShdPnd to /proc/<pid>/status.  Therefore there's absolutely no way to
find out if a SIGINT is pending from userspace.  The SIGSTOP will always be
delivered before a pending SIGINT because we sent the SIGSTOP with tkill,
which puts it onto the more specific queue.  Any other signal we sent with
tkill would have the same problem.

In other words, on a system with this kernel and LinuxThreads, SIGINT may
stop the inferior multiple times unpredictably.  On 2.5 we'll be able to do
something about it via ShdPnd; if Red Hat fixes their kernel then we'll be
able to do something about it on RH systems, but that's not my problem.  If
the problem still manifests next time I'm in 2.5 (and I haven't switched to
NPTL :) I'll put together the fix.

Ingo/Roland - might want to export ShdPnd in the RH kernels...

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


             reply	other threads:[~2003-07-27 16:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-27 16:17 Daniel Jacobowitz [this message]
2003-07-28 19:48 ` Roland McGrath
2003-07-28 19:49   ` Daniel Jacobowitz
2003-07-28 19:54     ` Roland McGrath
2003-07-28 20:00     ` Elena Zannoni

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=20030727161737.GA23676@nevyn.them.org \
    --to=drow@mvista.com \
    --cc=gdb@sources.redhat.com \
    --cc=mingo@redhat.com \
    --cc=roland@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