From d2f2c3d0c72ee8f6cade911f06b3a07ee449b687 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 13 Dec 2018 21:29:33 +1100 Subject: [PATCH] Generate a coredump on quit due to SIGSEGV --- src/main.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main.cc b/src/main.cc index 35fc86e4..608aefac 100644 --- a/src/main.cc +++ b/src/main.cc @@ -897,6 +897,12 @@ void signal_handler(int signal) if (signal == SIGTERM) exit(-1); + else if (signal == SIGSEGV) + { + // generate core dump + ::signal(SIGSEGV, SIG_DFL); + kill(getpid(), SIGSEGV); + } else abort(); }