Bug 243845

Summary: killing gdb debuggee leaves zombie processes
Product: Red Hat Enterprise Linux 4 Reporter: Bryn M. Reeves <bmr>
Component: gdbAssignee: Jan Kratochvil <jan.kratochvil>
Status: CLOSED ERRATA QA Contact:
Severity: high Docs Contact:
Priority: medium    
Version: 4.5CC: cagney
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: RHBA-2007-0811 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-11-15 16:12:05 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 244677    

Description Bryn M. Reeves 2007-06-12 10:52:31 UTC
Description of problem:
If the debuggee is killed while gdb is attached a pair of zombies remain until
the parent gdb process exits:

# ps ax | grep sleep
16425 pts/3    T      0:00 sleep 300
16430 pts/3    R+     0:00 grep sleep
# kill -9 16425
# ps ax | grep sleep
16425 pts/3    Z      0:00 [sleep] <defunct>
16432 pts/3    R+     0:00 grep sleep
# ps ax | grep gdb
16426 pts/4    S+     0:00 gdb -p 16425
16428 pts/4    Z+     0:00 [gdb] <defunct>
16434 pts/3    R+     0:00 grep gdb


Version-Release number of selected component (if applicable):
gdb-6.3.0.0-1.143.el4

How reproducible:
100%

Steps to Reproduce:
1. In one terminal start a process running, e.g.:
# sleep 300 &
[1] 16425

2. In another terminal attach the debugger:
# gdb -p 16425
GNU gdb Red Hat Linux (6.3.0.0-1.143.el4rh)
Copyright 2004 Free Software Foundation, Inc.
[...]
0x0081d7a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
(gdb)

3. Kill the debuggee:
# kill -9 16425

  
Actual results:
Two zombie processes now exist:

# ps ax | grep sleep
16425 pts/3    Z      0:00 [sleep] <defunct>
16432 pts/3    R+     0:00 grep sleep
# ps ax | grep gdb
16426 pts/4    S+     0:00 gdb -p 16425
16428 pts/4    Z+     0:00 [gdb] <defunct>
16434 pts/3    R+     0:00 grep gdb


Expected results:
No defunct processes remain.

Additional info:
The defunct processes are cleaned up when the parent GDB exits (pid 16426 in the
above examples).

This does not happen with the GDB in RHEL3 or FC6/F7.

Comment 2 RHEL Program Management 2007-06-12 11:05:20 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 15 errata-xmlrpc 2007-11-15 16:12:05 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2007-0811.html