public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "dje at google dot com" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug threads/10095] New: waitpid (xxx, &status, 0) call from gdb may hang
Date: Thu, 23 Apr 2009 22:10:00 -0000	[thread overview]
Message-ID: <20090423221013.10095.dje@google.com> (raw)

[filed so there's a point of reference for discussion of this issue]

If a ptracing parent calls waitpid (xxx, &status, 0) on a child with threads,
the call will hang if the main thread has exited.  xxx may be either pid or -1.

Arguably, it's counterintuitive for such a waitpid call to hang if all threads
are in the zombie state, but that's the kernel's behaviour (in 2.6.24-ish and
2.6.29-ish).  See kernel/exit.c:do_wait,et.al.

Attached is an example to illustrate the problem.

-- 
           Summary: waitpid (xxx, &status, 0) call from gdb may hang
           Product: gdb
           Version: 6.8
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: threads
        AssignedTo: unassigned at sourceware dot org
        ReportedBy: dje at google dot com
                CC: gdb-prs at sourceware dot org
 GCC build triplet: i686-pc-linux
  GCC host triplet: i686-pc-linux
GCC target triplet: i686-pc-linux


http://sourceware.org/bugzilla/show_bug.cgi?id=10095

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


             reply	other threads:[~2009-04-23 22:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-23 22:10 dje at google dot com [this message]
2009-04-23 22:21 ` [Bug threads/10095] " dje at google dot com

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=20090423221013.10095.dje@google.com \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).