sig-monitor: dump the stack on SIGABRT
[src/app-framework-binder.git] / src / sig-monitor.c
index fdaf8c0..fbc5b1f 100644 (file)
@@ -130,6 +130,8 @@ static inline void timeout_delete()
 static void on_signal_terminate (int signum)
 {
        ERROR("Terminating signal %d received: %s", signum, strsignal(signum));
+       if (signum == SIGABRT)
+               dumpstack(3);
        exit(1);
 }
 
@@ -171,8 +173,8 @@ static int install(void (*handler)(int), int *signals)
 
 int sig_monitor_init()
 {
-       static int sigerr[] = { SIG_FOR_TIMER, SIGSEGV, SIGFPE, 0 };
-       static int sigterm[] = { SIGINT, SIGABRT, 0 };
+       static int sigerr[] = { SIG_FOR_TIMER, SIGSEGV, SIGFPE, SIGILL, SIGBUS, 0 };
+       static int sigterm[] = { SIGINT, SIGABRT, SIGTERM, 0 };
 
        return (install(on_signal_error, sigerr) & install(on_signal_terminate, sigterm)) - 1;
 }