This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug threads/10095] New: waitpid (xxx, &status, 0) call from gdb may hang


[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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]