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:
parent
00845b17b9
commit
fd78d32e56
1 changed files with 1 additions and 2 deletions
|
@ -183,8 +183,7 @@ void segfault_handler(int signo) {
|
||||||
free(list);
|
free(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
signal(signo, SIG_DFL);
|
std::abort();
|
||||||
kill(getpid(), signo);
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue