Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: gdb-patches@sources.redhat.com
Subject: Re: [rfc] Fix linux_test_for_tracefork for newer kernels
Date: Sun, 21 Nov 2004 20:10:00 -0000	[thread overview]
Message-ID: <20041121200953.GA12837@nevyn.them.org> (raw)
In-Reply-To: <20041113222506.GA32180@nevyn.them.org>

On Sat, Nov 13, 2004 at 05:25:06PM -0500, Daniel Jacobowitz wrote:
> On Fri, Nov 12, 2004 at 05:59:41PM -0500, Daniel Jacobowitz wrote:
> > This patch makes the run-time test for fork tracing a little more robust.
> > In particular, it fixes two things:
> >   - If the test failed in an unexpected way, then two stopped processes
> >     could be left around.
> >   - Waitpid can be interrupted by EINTR.  Kernel 2.6.10-rc1 has some
> >     changes to wait and signal processing, which cause the SIGCHLD
> >     to be received before wait returns.  I don't think there's any
> >     actual bug here, since reissuing the wait works fine.
> > 
> > These changes let my testsuite runs finish without leaving hordes of stopped
> > processes around.  I won't check it in yet, since I haven't tested it on a
> > system where this runtime check should fail; in the meantime, I'm just
> > posting it for comments.  Hopefully I got it right this time!
> 
> Now I've tested it in a couple of other systems.  Here's a revised
> version, with a spurious warning fixed, and one additional improvement:
> on most systems lacking the support, we don't need to fork for the
> runtime test.  This fixes some problems in user-mode-linux, which does
> the most disgusting things with ptrace I have ever encountered.  Wow!
> 
> Barring comments, I'll check this in in a few days.

> 2004-11-12  Daniel Jacobowitz  <dan@debian.org>
> 
> 	* linux-nat.c (my_waitpid): New function.
> 	(linux_test_for_tracefork): Make more robust and verbose.  Take
> 	an ORIGINAL_PID argument and test for PTRACE_SETOPTIONS first.
> 	(linux_supports_tracefork, linux_supports_tracevforkdone): Take a PID
> 	argument.  Update calls to linux_test_for_tracefork.
> 	(linux_enable_event_reporting, child_follow_fork)
> 	(child_insert_fork_catchpoint, child_insert_vfork_catchpoint)
> 	(child_insert_exec_catchpoint): Update calls to
> 	linux_supports_tracefork and linux_supports_tracevforkdone.

I have checked this in.  It fixes a couple of hangs when running the
testsuite, for tests which expect GDB to exit, and it fixes the huge
number of zombies and stopped processes that my system has been
collecting every test run.

-- 
Daniel Jacobowitz


      reply	other threads:[~2004-11-21 20:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-12 22:59 Daniel Jacobowitz
2004-11-13 22:25 ` Daniel Jacobowitz
2004-11-21 20:10   ` Daniel Jacobowitz [this message]

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=20041121200953.GA12837@nevyn.them.org \
    --to=drow@false.org \
    --cc=gdb-patches@sources.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