fasching.a.9.1 at gmail dot com
2018-04-25 06:08:42 UTC
https://sourceware.org/bugzilla/show_bug.cgi?id=23119
Bug ID: 23119
Summary: GDB crashes when function evaluated by "print" calls
fork() with "detach-on-fork off" and "follow-fork-mode
child"
Product: gdb
Version: 8.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: gdb
Assignee: unassigned at sourceware dot org
Reporter: fasching.a.9.1 at gmail dot com
Target Milestone: ---
Created attachment 10987
--> https://sourceware.org/bugzilla/attachment.cgi?id=10987&action=edit
Script and program to reproduce the crash
OS: Arch Linux
Kernel: 4.16.3-1-ARCH x86_64 GNU/Linux
GDB version: GNU gdb (GDB) 8.1 (from Arch Linux repository)
Steps to reproduce:
C program with a function that calls fork():
$ cat program.c
#include <stdlib.h>
#include <sys/wait.h>
#include <unistd.h>
void foo(void) {
if (fork() > 0) {
wait(NULL);
} else {
exit(0);
}
}
int main(int argc, char **argv) {
return 0;
}
--------------------------------------------------------
Script to reproduce the error:
$ cat debug.gdb
set detach-on-fork off
set follow-fork-mode child
break main
run
print foo()
--------------------------------------------------------
Compile the program:
$ gcc -g -o program program.c
--------------------------------------------------------
Run gdb:
$ gdb --batch -x debug.gdb program
Breakpoint 1 at 0x70a: file program.c, line 14.
Breakpoint 1, main (argc=1, argv=0x7fffffffe058) at program.c:14
14 return 0;
[New process 20915]
Reading symbols from [...]/program...done.
infcall.c:1195: internal-error: value* call_function_by_hand_dummy(value*,
type*, int, value**, void (*)(void*, int), void*): Assertion `tp->thread_fsm ==
&sm->thread_fsm' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) [answered Y; input not from terminal]
This is a bug, please report it. For instructions, see:
<http://www.gnu.org/software/gdb/bugs/>.
infcall.c:1195: internal-error: value* call_function_by_hand_dummy(value*,
type*, int, value**, void (*)(void*, int), void*): Assertion `tp->thread_fsm ==
&sm->thread_fsm' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Create a core file of GDB? (y or n) [answered Y; input not from terminal]
[1] 20902 abort (core dumped) gdb --batch -x debug.gdb program
Bug ID: 23119
Summary: GDB crashes when function evaluated by "print" calls
fork() with "detach-on-fork off" and "follow-fork-mode
child"
Product: gdb
Version: 8.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: gdb
Assignee: unassigned at sourceware dot org
Reporter: fasching.a.9.1 at gmail dot com
Target Milestone: ---
Created attachment 10987
--> https://sourceware.org/bugzilla/attachment.cgi?id=10987&action=edit
Script and program to reproduce the crash
OS: Arch Linux
Kernel: 4.16.3-1-ARCH x86_64 GNU/Linux
GDB version: GNU gdb (GDB) 8.1 (from Arch Linux repository)
Steps to reproduce:
C program with a function that calls fork():
$ cat program.c
#include <stdlib.h>
#include <sys/wait.h>
#include <unistd.h>
void foo(void) {
if (fork() > 0) {
wait(NULL);
} else {
exit(0);
}
}
int main(int argc, char **argv) {
return 0;
}
--------------------------------------------------------
Script to reproduce the error:
$ cat debug.gdb
set detach-on-fork off
set follow-fork-mode child
break main
run
print foo()
--------------------------------------------------------
Compile the program:
$ gcc -g -o program program.c
--------------------------------------------------------
Run gdb:
$ gdb --batch -x debug.gdb program
Breakpoint 1 at 0x70a: file program.c, line 14.
Breakpoint 1, main (argc=1, argv=0x7fffffffe058) at program.c:14
14 return 0;
[New process 20915]
Reading symbols from [...]/program...done.
infcall.c:1195: internal-error: value* call_function_by_hand_dummy(value*,
type*, int, value**, void (*)(void*, int), void*): Assertion `tp->thread_fsm ==
&sm->thread_fsm' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) [answered Y; input not from terminal]
This is a bug, please report it. For instructions, see:
<http://www.gnu.org/software/gdb/bugs/>.
infcall.c:1195: internal-error: value* call_function_by_hand_dummy(value*,
type*, int, value**, void (*)(void*, int), void*): Assertion `tp->thread_fsm ==
&sm->thread_fsm' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Create a core file of GDB? (y or n) [answered Y; input not from terminal]
[1] 20902 abort (core dumped) gdb --batch -x debug.gdb program
--
You are receiving this mail because:
You are on the CC list for the bug.
You are receiving this mail because:
You are on the CC list for the bug.