Discussion:
[Bug gdb/22629] New: GDB on MacOS is leaving an orphaned debuggee process running
abdul.basitijaz at gmail dot com
2017-12-18 14:22:58 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=22629

Bug ID: 22629
Summary: GDB on MacOS is leaving an orphaned debuggee process
running
Product: gdb
Version: 8.0.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: gdb
Assignee: unassigned at sourceware dot org
Reporter: abdul.basitijaz at gmail dot com
Target Milestone: ---

GDB on MacOS(10.12.3) is leaving an orphaned debuggee process running on the
system after gdb exits.

Issue can be verified with any cpp executable out file.

To reproduce, compile any cpp program then run it under gdb, then quit gdb
during debugging :

For compilation :
g++ -g -c <ANY_TEST>.cpp
g++ -g <ANY_TEST>.o -o <ANY_TEST>.exe
gdb
file <ANY_TEST>.exe
b main
r
After break point is hit quit the GDB and verify the process list
r or q (for both f these commands GDB shows that inferior process will be killed but it is not getting killed )
ps ax |grep <ANY_TEST>.exe
<ANY_TEST>.exe will be shown that it is still running . So as many times you
perform above steps process will keep adding here

Test Environment info :

macOS 10.12.3
Kernel Version: Darwin 16.4.0
GNU gdb (GDB) 8.0.1
--
You are receiving this mail because:
You are on the CC list for the bug.
tromey at sourceware dot org
2018-07-03 15:42:45 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=22629

Tom Tromey <tromey at sourceware dot org> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2018-07-03
CC| |tromey at sourceware dot org
Ever confirmed|0 |1

--- Comment #1 from Tom Tromey <tromey at sourceware dot org> ---
I didn't try it yet, but I've seen this report before, and Tristan
wrote a patch to fix it.
--
You are receiving this mail because:
You are on the CC list for the bug.
tromey at sourceware dot org
2018-07-09 10:48:49 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=22629

Tom Tromey <tromey at sourceware dot org> changed:

What |Removed |Added
----------------------------------------------------------------------------
Target| |*-*-darwin*
--
You are receiving this mail because:
You are on the CC list for the bug.
tromey at sourceware dot org
2018-07-18 19:36:07 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=22629

--- Comment #2 from Tom Tromey <tromey at sourceware dot org> ---
It was Xavier's patch, not Tristan's in this case.
I've rebased it and submitted it:
https://sourceware.org/ml/gdb-patches/2018-07/msg00427.html
--
You are receiving this mail because:
You are on the CC list for the bug.
cvs-commit at gcc dot gnu.org
2018-08-02 22:05:23 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=22629

--- Comment #3 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tom Tromey <***@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=1584354913285389063622a39f845851f332eb9a

commit 1584354913285389063622a39f845851f332eb9a
Author: Xavier Roirand <***@adacore.com>
Date: Thu Jun 8 18:10:18 2017 +0200

Fix kill issue leading to zombie process on MacOS Sierra

Starting with MacOS version Sierra, the gdb kill command
seems to work but inferior remains as zombie on the host.
Notice that, as zombie process, the inferior is not killable
by the user, nor by root.

The kill signal gdb sent to the inferior is not handled
in gdb as a signal sent by gdb thus no reply is made and
the process remains (since MacOS does not "release" the
inferior because no reply have been made to the signal
message).

This patch fixes this problem.

gdb/ChangeLog
2018-08-02 Xavier Roirand <***@adacore.com>

PR gdb/22629:
* darwin-nat.c (darwin_kill_inferior): Fix handling of
kill inferior.
--
You are receiving this mail because:
You are on the CC list for the bug.
tromey at sourceware dot org
2018-08-02 16:40:40 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=22629

Tom Tromey <tromey at sourceware dot org> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED

--- Comment #4 from Tom Tromey <tromey at sourceware dot org> ---
Fixed.

I didn't set the target milestone because 8.3 isn't a choice yet.
--
You are receiving this mail because:
You are on the CC list for the bug.
tromey at sourceware dot org
2018-08-10 15:26:05 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=22629

Tom Tromey <tromey at sourceware dot org> changed:

What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |8.3
--
You are receiving this mail because:
You are on the CC list for the bug.
Loading...