simon.marchi at ericsson dot com
2018-03-30 14:53:28 UTC
https://sourceware.org/bugzilla/show_bug.cgi?id=23020
Bug ID: 23020
Summary: GDB gets stopped by SIGTTOU when breakpoint insertion
in fork child fails
Product: gdb
Version: HEAD
Status: NEW
Severity: normal
Priority: P2
Component: gdb
Assignee: unassigned at sourceware dot org
Reporter: simon.marchi at ericsson dot com
Target Milestone: ---
This bug started with commit e671cd59d74c ("Per-inferior target_terminal state,
fix PR gdb/13211, more"). Here's how I can reproduce:
$ cat test.c
#include <unistd.h>
static void
break_here ()
{
}
int
main (int argc, char *argv[])
{
fork ();
break_here();
return 0;
}
$ gcc test.c -g3 -O0 -o test -pie
$ ./gdb -nx -q --data-directory=data-directory test -ex "set detach-on-fork
off" -ex "b break_here" -ex "set non-stop on"
Reading symbols from test...done.
Breakpoint 1 at 0x64e: file test.c, line 6.
(gdb) r
Starting program: /home/simark/build/binutils-gdb-one-target/gdb/test
[New process 1465]
Reading symbols from
/home/simark/build/binutils-gdb-one-target/gdb/test...done.
[2] + 1451 suspended (tty output) ./gdb -nx -q
--data-directory=data-directory test -ex "set detach-on-fork off
$ fg
[2] - 1451 continued ./gdb -nx -q --data-directory=data-directory test -ex
"set detach-on-fork off
Warning:
Cannot insert breakpoint 1.
Cannot access memory at address 0x64a
(gdb)
To be clear, the bug here is that GDB gets stopped by SIGTTOU. The fact that
the breakpoint fails to be inserted is another bug that should get looked at
separately. It just happens to trigger the terminal output bug.
I suspect that GDB tries to do some output while the terminal is owned by the
inferior.
Bug ID: 23020
Summary: GDB gets stopped by SIGTTOU when breakpoint insertion
in fork child fails
Product: gdb
Version: HEAD
Status: NEW
Severity: normal
Priority: P2
Component: gdb
Assignee: unassigned at sourceware dot org
Reporter: simon.marchi at ericsson dot com
Target Milestone: ---
This bug started with commit e671cd59d74c ("Per-inferior target_terminal state,
fix PR gdb/13211, more"). Here's how I can reproduce:
$ cat test.c
#include <unistd.h>
static void
break_here ()
{
}
int
main (int argc, char *argv[])
{
fork ();
break_here();
return 0;
}
$ gcc test.c -g3 -O0 -o test -pie
$ ./gdb -nx -q --data-directory=data-directory test -ex "set detach-on-fork
off" -ex "b break_here" -ex "set non-stop on"
Reading symbols from test...done.
Breakpoint 1 at 0x64e: file test.c, line 6.
(gdb) r
Starting program: /home/simark/build/binutils-gdb-one-target/gdb/test
[New process 1465]
Reading symbols from
/home/simark/build/binutils-gdb-one-target/gdb/test...done.
[2] + 1451 suspended (tty output) ./gdb -nx -q
--data-directory=data-directory test -ex "set detach-on-fork off
$ fg
[2] - 1451 continued ./gdb -nx -q --data-directory=data-directory test -ex
"set detach-on-fork off
Warning:
Cannot insert breakpoint 1.
Cannot access memory at address 0x64a
(gdb)
To be clear, the bug here is that GDB gets stopped by SIGTTOU. The fact that
the breakpoint fails to be inserted is another bug that should get looked at
separately. It just happens to trigger the terminal output bug.
I suspect that GDB tries to do some output while the terminal is owned by the
inferior.
--
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.