From fd78d32e567d943c430372ce5a9b789cc6024309 Mon Sep 17 00:00:00 2001 From: Florent Rougon Date: Thu, 11 May 2017 12:19:31 +0200 Subject: [PATCH] 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 . --- src/Main/bootstrap.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Main/bootstrap.cxx b/src/Main/bootstrap.cxx index 93a15e46b..61c4089df 100644 --- a/src/Main/bootstrap.cxx +++ b/src/Main/bootstrap.cxx @@ -183,8 +183,7 @@ void segfault_handler(int signo) { free(list); } - signal(signo, SIG_DFL); - kill(getpid(), signo); + std::abort(); } #endif