gnu/77818: GDB locks in wait4() when running applications

Seán C. Farley sean-freebsd at
Wed May 25 15:50:05 GMT 2005

The following reply was made to PR gnu/77818; it has been noted by GNATS.

From: =?ISO-8859-1?Q?Se=E1n_C=2E_Farley?= <sean-freebsd at>
To: David Xu <davidxu at>
Cc: bug-followup at
Subject: Re: gnu/77818: GDB locks in wait4() when running applications
Date: Wed, 25 May 2005 10:41:14 -0500 (CDT)

   This message is in MIME format.  The first part should be readable text,
   while the remaining parts are likely unreadable without MIME-aware tools.
 Content-Type: TEXT/PLAIN; charset=ISO-8859-1; format=flowed
 Content-Transfer-Encoding: QUOTED-PRINTABLE
 On Wed, 25 May 2005, David Xu wrote:
 >> I have a new test program[1] that I think shows the problem.  My
 >> previous program actually showed another bug that has since been
 >> fixed.  Actually, it shows two problems.  When run within the
 >> debugger (SHELL=3D3D/bin/sh gdb a.out), the parent will be stuck
 >> waiting for a signal it will never receive in sigsuspend().
 > Please try following patch, I believe the old hack is incorrect now
 > with jhb's sleep queue.
 <patch snip>
 Thank you, thank you!  That fixes my bug.
 >> The other problem is that nanosleep() is exiting immediately with a
 >> return of zero although the time to sleep has not passed.  To see it
 >> do this, remove the BROKEN_NANOSLEEP_WITHIN_GDB definition at the top
 >> of the program and recompile.
 > This is a long history bug, I believe it is still in RELENG_4. Now the
 > bug is in kern_sig.c: do_tdsignal(), when process is being debugged, a
 > masked signal can wake up a sleeping thread! that's why it is broken.
 Is it fixable?  Should I open a PR for it, or is there one already?
 sean-freebsd at

More information about the freebsd-bugs mailing list