From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26645 invoked by alias); 23 Apr 2009 22:10:15 -0000 Received: (qmail 26629 invoked by uid 48); 23 Apr 2009 22:10:14 -0000 Date: Thu, 23 Apr 2009 22:10:00 -0000 From: "dje at google dot com" To: gdb-prs@sourceware.org Message-ID: <20090423221013.10095.dje@google.com> Reply-To: sourceware-bugzilla@sourceware.org Subject: [Bug threads/10095] New: waitpid (xxx, &status, 0) call from gdb may hang X-Bugzilla-Reason: CC Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org X-SW-Source: 2009-q2/txt/msg00065.txt.bz2 [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.