public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/31209] New: [gdb, delete checkpoint] inferior.c:406: internal-error: find_inferior_pid: Assertion `pid != 0' failed.
@ 2024-01-03 14:16 vries at gcc dot gnu.org
2024-01-03 14:17 ` [Bug gdb/31209] " vries at gcc dot gnu.org
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: vries at gcc dot gnu.org @ 2024-01-03 14:16 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=31209
Bug ID: 31209
Summary: [gdb, delete checkpoint] inferior.c:406:
internal-error: find_inferior_pid: Assertion `pid !=
0' failed.
Product: gdb
Version: 15.1
Status: NEW
Severity: normal
Priority: P2
Component: gdb
Assignee: unassigned at sourceware dot org
Reporter: vries at gcc dot gnu.org
Target Milestone: ---
I played around with checkpoints on a hello world exec, and ran into an
assertion failure:
...
$ gdb -q -batch a.out -ex "set trace-commands on" -x gdb.in
+start
Temporary breakpoint 1 at 0x4101b0: file hello.c, line 6.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Temporary breakpoint 1, main () at hello.c:6
6 printf ("hello\n");
+checkpoint
+next
hello
8 return 0;
+restart 1
Switching to Thread 0xfffff7ffed80 (LWP 1325214)
#0 main () at hello.c:6
6 printf ("hello\n");
+delete checkpoint 0
/home/vries/gdb/src/gdb/inferior.c:406: internal-error: find_inferior_pid:
Assertion `pid != 0' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
----- Backtrace -----
0x57f597 gdb_internal_backtrace_1
/home/vries/gdb/src/gdb/bt-utils.c:122
0x57f65b _Z22gdb_internal_backtracev
/home/vries/gdb/src/gdb/bt-utils.c:168
0xb7c463 internal_vproblem
/home/vries/gdb/src/gdb/utils.c:396
0xb7c87f _Z15internal_verrorPKciS0_St9__va_list
/home/vries/gdb/src/gdb/utils.c:476
0xdbfcff _Z18internal_error_locPKciS0_z
/home/vries/gdb/src/gdbsupport/errors.cc:58
0x804863 _Z17find_inferior_pidP22process_stratum_targeti
/home/vries/gdb/src/gdb/inferior.c:406
0x804917 _Z18find_inferior_ptidP22process_stratum_target6ptid_t
/home/vries/gdb/src/gdb/inferior.c:420
0x9269bf _ZN22process_stratum_target11find_threadE6ptid_t
/home/vries/gdb/src/gdb/process-stratum-target.c:191
0x85756b delete_checkpoint_command
/home/vries/gdb/src/gdb/linux-fork.c:544
0x5d288b do_simple_func
/home/vries/gdb/src/gdb/cli/cli-decode.c:95
0x5d7c1b _Z8cmd_funcP16cmd_list_elementPKci
/home/vries/gdb/src/gdb/cli/cli-decode.c:2735
0xadf8df _Z15execute_commandPKci
/home/vries/gdb/src/gdb/top.c:575
0x763493 _Z15command_handlerPKc
/home/vries/gdb/src/gdb/event-top.c:566
0xadef97 _Z17read_command_fileP8_IO_FILE
/home/vries/gdb/src/gdb/top.c:342
0x5e66cf _Z16script_from_fileP8_IO_FILEPKc
/home/vries/gdb/src/gdb/cli/cli-script.c:1642
0x5c9cc3 source_script_from_stream
/home/vries/gdb/src/gdb/cli/cli-cmds.c:730
0x5c9ddf source_script_with_search
/home/vries/gdb/src/gdb/cli/cli-cmds.c:775
0x5c9e4b _Z13source_scriptPKci
/home/vries/gdb/src/gdb/cli/cli-cmds.c:784
0x893ea3 catch_command_errors
/home/vries/gdb/src/gdb/main.c:514
0x894083 execute_cmdargs
/home/vries/gdb/src/gdb/main.c:610
0x8956c3 captured_main_1
/home/vries/gdb/src/gdb/main.c:1312
0x895883 captured_main
/home/vries/gdb/src/gdb/main.c:1333
0x89590b _Z8gdb_mainP18captured_main_args
/home/vries/gdb/src/gdb/main.c:1362
0x4239b3 main
/home/vries/gdb/src/gdb/gdb.c:39
...
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug gdb/31209] [gdb, delete checkpoint] inferior.c:406: internal-error: find_inferior_pid: Assertion `pid != 0' failed.
2024-01-03 14:16 [Bug gdb/31209] New: [gdb, delete checkpoint] inferior.c:406: internal-error: find_inferior_pid: Assertion `pid != 0' failed vries at gcc dot gnu.org
@ 2024-01-03 14:17 ` vries at gcc dot gnu.org
2024-01-03 14:30 ` vries at gcc dot gnu.org
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: vries at gcc dot gnu.org @ 2024-01-03 14:17 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=31209
--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
FWIW, command file:
...
$ cat gdb.in
start
checkpoint
next
restart 1
delete checkpoint 0
...
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug gdb/31209] [gdb, delete checkpoint] inferior.c:406: internal-error: find_inferior_pid: Assertion `pid != 0' failed.
2024-01-03 14:16 [Bug gdb/31209] New: [gdb, delete checkpoint] inferior.c:406: internal-error: find_inferior_pid: Assertion `pid != 0' failed vries at gcc dot gnu.org
2024-01-03 14:17 ` [Bug gdb/31209] " vries at gcc dot gnu.org
@ 2024-01-03 14:30 ` vries at gcc dot gnu.org
2024-01-08 15:27 ` vries at gcc dot gnu.org
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: vries at gcc dot gnu.org @ 2024-01-03 14:30 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=31209
--- Comment #2 from Tom de Vries <vries at gcc dot gnu.org> ---
Fixed by:
...
diff --git a/gdb/linux-fork.c b/gdb/linux-fork.c
index 1430ff89fa7..8156b51897b 100644
--- a/gdb/linux-fork.c
+++ b/gdb/linux-fork.c
@@ -537,6 +537,9 @@ Please switch to another checkpoint before deleting the
current one"));
delete_fork (ptid);
+ if (pptid == null_ptid)
+ return;
+
/* If fi->parent_ptid is not a part of lwp but it's a part of checkpoint
list, waitpid the ptid.
If fi->parent_ptid is a part of lwp and it is stopped, waitpid the
...
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug gdb/31209] [gdb, delete checkpoint] inferior.c:406: internal-error: find_inferior_pid: Assertion `pid != 0' failed.
2024-01-03 14:16 [Bug gdb/31209] New: [gdb, delete checkpoint] inferior.c:406: internal-error: find_inferior_pid: Assertion `pid != 0' failed vries at gcc dot gnu.org
2024-01-03 14:17 ` [Bug gdb/31209] " vries at gcc dot gnu.org
2024-01-03 14:30 ` vries at gcc dot gnu.org
@ 2024-01-08 15:27 ` vries at gcc dot gnu.org
2024-01-10 10:27 ` cvs-commit at gcc dot gnu.org
2024-01-10 10:28 ` vries at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: vries at gcc dot gnu.org @ 2024-01-08 15:27 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=31209
--- Comment #3 from Tom de Vries <vries at gcc dot gnu.org> ---
https://sourceware.org/pipermail/gdb-patches/2024-January/205704.html
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug gdb/31209] [gdb, delete checkpoint] inferior.c:406: internal-error: find_inferior_pid: Assertion `pid != 0' failed.
2024-01-03 14:16 [Bug gdb/31209] New: [gdb, delete checkpoint] inferior.c:406: internal-error: find_inferior_pid: Assertion `pid != 0' failed vries at gcc dot gnu.org
` (2 preceding siblings ...)
2024-01-08 15:27 ` vries at gcc dot gnu.org
@ 2024-01-10 10:27 ` cvs-commit at gcc dot gnu.org
2024-01-10 10:28 ` vries at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-01-10 10:27 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=31209
--- Comment #4 from Sourceware Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tom de Vries <vries@sourceware.org>:
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=83094d3de44846071cc2e3e42366ea782b3e4027
commit 83094d3de44846071cc2e3e42366ea782b3e4027
Author: Tom de Vries <tdevries@suse.de>
Date: Wed Jan 10 11:27:34 2024 +0100
[gdb] Fix assertion failure for checkpoint delete 0
When doing "checkpoint delete 0" we run into an assertion failure:
...
+delete checkpoint 0
inferior.c:406: internal-error: find_inferior_pid: Assertion `pid != 0'
failed.
...
Fix this by handling the "pptid == null_ptid" case in
delete_checkpoint_command.
Tested on x86_64-linux.
Approved-By: Kevin Buettner <kevinb@redhat.com>
PR gdb/31209
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31209
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug gdb/31209] [gdb, delete checkpoint] inferior.c:406: internal-error: find_inferior_pid: Assertion `pid != 0' failed.
2024-01-03 14:16 [Bug gdb/31209] New: [gdb, delete checkpoint] inferior.c:406: internal-error: find_inferior_pid: Assertion `pid != 0' failed vries at gcc dot gnu.org
` (3 preceding siblings ...)
2024-01-10 10:27 ` cvs-commit at gcc dot gnu.org
@ 2024-01-10 10:28 ` vries at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: vries at gcc dot gnu.org @ 2024-01-10 10:28 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=31209
Tom de Vries <vries at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Version|15.1 |HEAD
Resolution|--- |FIXED
Target Milestone|--- |15.1
Status|NEW |RESOLVED
--- Comment #5 from Tom de Vries <vries at gcc dot gnu.org> ---
Fixed.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-01-10 10:28 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-03 14:16 [Bug gdb/31209] New: [gdb, delete checkpoint] inferior.c:406: internal-error: find_inferior_pid: Assertion `pid != 0' failed vries at gcc dot gnu.org
2024-01-03 14:17 ` [Bug gdb/31209] " vries at gcc dot gnu.org
2024-01-03 14:30 ` vries at gcc dot gnu.org
2024-01-08 15:27 ` vries at gcc dot gnu.org
2024-01-10 10:27 ` cvs-commit at gcc dot gnu.org
2024-01-10 10:28 ` vries at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).