Discussion:
[Bug gdb/18050] New: gdb crash on target remote, w/ two inferiors, current inferior is live
dje at google dot com
2015-02-27 18:29:08 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=18050

Bug ID: 18050
Summary: gdb crash on target remote, w/ two inferiors, current
inferior is live
Product: gdb
Version: HEAD
Status: NEW
Severity: normal
Priority: P2
Component: gdb
Assignee: unassigned at sourceware dot org
Reporter: dje at google dot com

bash1$ gdbserver :1234 foo
bash2$ gdb foo
(gdb) start
(gdb) add-infer -exec foo
(gdb) tar ext :1234
../../tab-completion-prep/gdb/thread.c:514: internal-error:
any_thread_of_process: Assertion `pid != 0' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n)
--
You are receiving this mail because:
You are on the CC list for the bug.
cvs-commit at gcc dot gnu.org
2018-08-08 12:20:34 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=18050

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

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

commit 9d4a934ce604afea155c39f06834cdbc47e92a6e
Author: Andrew Burgess <***@embecosm.com>
Date: Fri Jun 22 20:39:26 2018 +0100

gdb: Fix assert for extended-remote target (PR gdb/18050)

Consider the following GDB session:

(gdb) target extended-remote :2347
(gdb) file /path/to/exe
(gdb) set remote exec-file /path/to/exe
(gdb) set detach-on-fork off
(gdb) break breakpt
(gdb) run
# ... hits breakpoint
(gdb) info inferiors
Num Description Executable
* 1 process 17001 /path/to/exe
2 process 17002 /path/to/exe
(gdb) kill
(gdb) info inferiors
Num Description Executable
* 1 <null> /path/to/exe
2 process 17002 /path/to/exe
(gdb) target extended-remote :2348
../../src/gdb/thread.c:660: internal-error: thread_info*
any_thread_of_process(int): Assertion `pid != 0' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.

Or, from bug PR gdb/18050:

(gdb) start
(gdb) add-inferior -exec /path/to/exe
(gdb) target extended-remote :2347
../../src/gdb/thread.c:660: internal-error: thread_info*
any_thread_of_process(int): Assertion `pid != 0' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.

The issue is calling target.c:dispose_inferior with a killed inferior in
the inferior list. This assertion is fixed in this commit.

The new test for this issue only runs on platforms that support
'detach-on-fork', and when using
'--target_board=native-extended-gdbserver'.

gdb/ChangeLog:

PR gdb/18050:
* target.c (dispose_inferior): Don't dispose of inferiors that are
already killed.

gdb/testsuite/ChangeLog:

PR gdb/18050:
* gdb.server/extended-remote-restart.c: New file.
* gdb.server/extended-remote-restart.exp: New file.
--
You are receiving this mail because:
You are on the CC list for the bug.
andrew.burgess at embecosm dot com
2018-08-08 12:25:29 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=18050

Andrew Burgess <andrew.burgess at embecosm dot com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
CC| |andrew.burgess at embecosm dot com
Resolution|--- |FIXED

--- Comment #2 from Andrew Burgess <andrew.burgess at embecosm dot com> ---
This should now be fixed with commit 9d4a934ce60 on the master branch.
--
You are receiving this mail because:
You are on the CC list for the bug.
Loading...