Open richlowe opened 4 months ago
I traced this, and nobody is noticeably attaching an 0xffffff..f
handler to anything. The SIGINT handler is valid as far as psig
just before we crash, but I know gdb does weird things changing handlers in handlers and all of that fun.
I'm going to assume the 0xffff...ff
in the trace is an artifact of the signal frames (which I thought got elided from traces completely, but I guess doesn't?) and something deeper is wrong.
Unfortunately it's just an assumption, because if I trace this it doesn't crash.
This is actually general to gdb and signals, at list SIGINT
.
You can test this quickly, at least in a bourne-like shell, by doing
gdb -p $$
...
0xfffffc7feedcbada in __read () from /usr/lib/amd64/libc.so.1
=> 0xfffffc7feedcbada <__read+10>: 73 0a jae 0xfffffc7feedcbae6 <__read+22>
(gdb) cont
Continuing.
If you now hit ^C
gdb will segfault having taken SIGINT
in a loop until the stack is blown
Ok, apparently that might (often?) require the victim and gdb process to be in different ttys. So in one terminal
$ bash
$ echo $$
31415
$
in another
gdb -p 31415
cont
^C
I don't have much details here unfortunately.
I have gdb in one terminal attached to qemu, which qemu running in another (with a disabled breakpoint). If I hit ^C in gdb to interrupt qemu, gdb segfaults, having blown its stack recursively handling SIGINT:
the bottom of the stack is:
That jump to -1 can't be good, and leaves me worried that me having added types to
SIG_ERR
managed to break something. It implies the flow here is that we have done:without ever having checked
foo != SIG_ERR
, or something like that.