From: Vladimir Prus <ghost@cs.msu.su>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gdb-patches@sourceware.org, Hamish Rodda <rodda@kde.org>,
Daniel Jacobowitz <dan@codesourcery.com>
Subject: Re: SIGCHLD ignored
Date: Thu, 12 Jun 2008 18:30:00 -0000 [thread overview]
Message-ID: <200806122036.17390.ghost@cs.msu.su> (raw)
In-Reply-To: <200806120018.05719.pedro@codesourcery.com>
On Thursday 12 June 2008 03:18:05 Pedro Alves wrote:
> [moved to gdb-patches@]
>
> Original report here:
> SIGCHLD ignored
> http://sourceware.org/ml/gdb/2008-06/msg00099.html
>
> A Wednesday 11 June 2008 23:45:22, Pedro Alves wrote:
> > A Wednesday 11 June 2008 18:21:05, Vladimir Prus wrote:
> > > Pedro, I think this SIGCHLD magic is your doing -- do you have any ideas
> > > how to fix it?
> >
> > Dang, I totally missed this could be a problem.
> >
> > Right, so, normal_mask has SIGCHLD blocked in _initialize_linux_nat,
> > and since forking a child inherits the signal mask, the child gets
> > SIGCHLD blocked by default. This would have gone unnoticed
> > if Qt unblocked SIGCHLD in it's setup (one may argue it should).
> >
> > It's not safe to just remove that SIGCHLD blocking, we're not
> > taking care of blocking it in places we used to in sync mode
> > (we used to block it the first time we hit linux_nat_wait, which
> > is reached after forking an inferior).
> >
> > For async mode, we also need to do something about SIGCHLD
> > blocking. We have:
> >
> > linux_nat_create_inferior
> > -> linux_nat_async_mask
> > -> linux_nat_async
> > -> linux_nat_async_events
> > -> block SIGCHLD.
> >
> > -> linux_ops->to_create_inferior (forks a child)
> >
> > Attached is a patch to fix this.
> >
> > Basically, I turned linux_nat_async_events_enabled into a
> > 3-state instead of a bool, with the new state being
> > "SIGCHLD unblocked with action set to whatever we get
> > on startup". Most of the SIGCHLD state management stays with
> > the same logic, except that linux_nat_create_inferior gets a
> > switch to the new state before forking a child, and
> > linux_nat_wait, gets an unconditional switch to the blocked
> > state. The rest of the patch is mostly updating to the
> > new interface.
> >
> > Tested on x86-64-unknown-linux-gnu sync and async modes
> > without regressions.
>
> Same code patch, but updated with a new testcase. I imagine
> we're going to touch these issues again with full
> multi-process support.
This patch works fine for me, and (with my limited understanding of the code),
makes sense. Can we get it in?
- Volodya
next prev parent reply other threads:[~2008-06-12 16:37 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200806112121.06783.ghost@cs.msu.su>
[not found] ` <200806112345.22321.pedro@codesourcery.com>
2008-06-12 5:51 ` Pedro Alves
2008-06-12 18:30 ` Vladimir Prus [this message]
2008-06-13 10:29 ` Pedro Alves
2008-06-13 13:17 ` Vladimir Prus
2008-06-13 14:32 ` Pedro Alves
2008-06-26 14:14 ` Daniel Jacobowitz
2008-06-28 11:57 ` Pedro Alves
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=200806122036.17390.ghost@cs.msu.su \
--to=ghost@cs.msu.su \
--cc=dan@codesourcery.com \
--cc=gdb-patches@sourceware.org \
--cc=pedro@codesourcery.com \
--cc=rodda@kde.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