Generate a coredump on quit due to SIGSEGV

This commit is contained in:
Maxime Coste 2018-12-13 21:29:33 +11:00
parent e49a0d2581
commit d2f2c3d0c7

View File

@ -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();
}