From: Mark Kettenis <mark.kettenis@xs4all.nl>
To: drow@false.org
Cc: gdb-patches@sourceware.org
Subject: Re: [linux] Always ignore restart/cancellation signals
Date: Sat, 10 Dec 2005 01:49:00 -0000 [thread overview]
Message-ID: <200512092049.jB9Kn59V026226@elgar.sibelius.xs4all.nl> (raw)
In-Reply-To: <20051209185810.GA18701@nevyn.them.org> (message from Daniel Jacobowitz on Fri, 9 Dec 2005 13:58:10 -0500)
> Date: Fri, 9 Dec 2005 13:58:10 -0500
> From: Daniel Jacobowitz <drow@false.org>
>
> On Fri, Dec 09, 2005 at 08:51:23PM +0200, Eli Zaretskii wrote:
> > > Date: Fri, 9 Dec 2005 09:46:51 -0500
> > > From: Daniel Jacobowitz <drow@false.org>
> > >
> > > On Fri, Dec 09, 2005 at 04:44:16PM +0200, Eli Zaretskii wrote:
> > > > > Date: Fri, 9 Dec 2005 09:34:52 -0500
> > > > > From: Daniel Jacobowitz <drow@false.org>
> > > > >
> > > > > The problem is that an application may want to register handlers for "a
> > > > > few" realtime signals. It seems common to count up from SIGRTMIN, so
> > > > > SIGRTMIN is made a runtime constant that skips those signals belonging
> > > > > to the implementation.
> > > >
> > > > Does this mean that ``constants aren't'', like the old joke says?
> > >
> > > Precisely! Directly above the bit Kevin quoted:
> > >
> > > #define SIGRTMIN (__libc_current_sigrtmin ())
> > > #define SIGRTMAX (__libc_current_sigrtmax ())
> >
> > Then we should probably use these instead.
>
> No, we shouldn't. Let me try the explanation over from the top.
>
> The thread library reserves some realtime signals to itself. These are
> specifically those between __SIGRTMIN (a constant) and SIGRTMIN (a
> function call). A well-behaved application should not manually
> generate those signals nor attempt to handle them.
>
> But GDB isn't trying to use realtime signals. It's trying to find the
> signals used by the inferior's threading implementation, so that it can
> transparently ignore them, instead of stopping the application by
> default every time that a thread is cancelled (or, for LinuxThreads,
> every time a thread blocked on a mutex is woken!).
>
> If the thread library is kind enough to tell us which signals it is
> using, then we use those numbers. If it isn't, we must guess. The
> only correct guess is __SIGRTMIN (32 on all Linux systems, and this is
> Linux-specific code...) and __SIGRTMIN+1. SIGRTMIN is generally 34 or
> 35, and would be the right choice for GDB to use in sending its own
> signals to itself.
Ah yes, it all comes back to me. Believe SIGRTMIN will be 32, unless
you link your stuff with libpthreads, since that consumes two signals
for internal use, and therefore SIGRTMIN will be 34. Are the signal
numbers hardcoded in libpthread (in particular the NPTL one) or does
it depend on whether there are other consumers of real-time signals?
Mark
next prev parent reply other threads:[~2005-12-09 20:49 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-08 21:10 Daniel Jacobowitz
2005-12-09 10:39 ` Mark Kettenis
2005-12-09 11:09 ` Kevin Buettner
2005-12-09 11:26 ` Daniel Jacobowitz
2005-12-09 11:48 ` Kevin Buettner
2005-12-09 14:46 ` Eli Zaretskii
2005-12-09 20:52 ` Daniel Jacobowitz
2005-12-09 20:49 ` Daniel Jacobowitz
2005-12-09 21:55 ` Eli Zaretskii
2005-12-09 23:13 ` Daniel Jacobowitz
2005-12-10 1:20 ` Eli Zaretskii
2005-12-10 1:29 ` Daniel Jacobowitz
2005-12-10 1:29 ` Eli Zaretskii
2005-12-10 1:49 ` Mark Kettenis [this message]
2005-12-10 2:10 ` Daniel Jacobowitz
2005-12-10 4:47 ` Mark Kettenis
2005-12-10 1:34 ` Jim Blandy
2005-12-11 17:26 ` Eli Zaretskii
2006-02-20 17:01 ` Daniel Jacobowitz
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=200512092049.jB9Kn59V026226@elgar.sibelius.xs4all.nl \
--to=mark.kettenis@xs4all.nl \
--cc=drow@false.org \
--cc=gdb-patches@sourceware.org \
/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