diff options
Diffstat (limited to 'src/common/core.c')
-rw-r--r-- | src/common/core.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/common/core.c b/src/common/core.c index 5924a0aa6..60d25546a 100644 --- a/src/common/core.c +++ b/src/common/core.c @@ -92,6 +92,13 @@ static void sig_proc(int sn) exit(0); runflag = 0; break; + case SIGSEGV: + case SIGFPE: + do_abort(); + // Pass the signal to the system's default handler + compat_signal(sn, SIG_DFL); + raise(sn); + break; #ifndef _WIN32 case SIGXFSZ: // ignore and allow it to set errno to EFBIG @@ -109,10 +116,10 @@ void signals_init (void) { compat_signal(SIGTERM, sig_proc); compat_signal(SIGINT, sig_proc); + compat_signal(SIGSEGV, sig_proc); + compat_signal(SIGFPE, sig_proc); // Signal to create coredumps by system when necessary (crash) - compat_signal(SIGSEGV, SIG_DFL); - compat_signal(SIGFPE, SIG_DFL); compat_signal(SIGILL, SIG_DFL); #ifndef _WIN32 compat_signal(SIGXFSZ, sig_proc); |