1
0
Fork 0

End segfault_handler() with std::abort() rather than kill() on ourselves

This has the advantage, according to my testing on Linux, that core
files obtained after a crash now point to the crashing thread again,
when one starts 'gdb' on the core file and runs the 'bt' command.

Apparently, when using kill(), the signal is seen as coming from the
outside and gdb's 'bt' command points to the wrong thread in general
when debugging using a core file (when debugging "live", gdb intercepts
the signal even before FG's signal handler is started).

See discussion starting at
<https://sourceforge.net/p/flightgear/mailman/message/35833221/>.
This commit is contained in:
Florent Rougon 2017-05-11 12:19:31 +02:00
parent 00845b17b9
commit fd78d32e56

View file

@ -183,8 +183,7 @@ void segfault_handler(int signo) {
free(list);
}
signal(signo, SIG_DFL);
kill(getpid(), signo);
std::abort();
}
#endif