BackTrace bt(0);
bt.print(*_dout);
- old_sigsegv_handler(signum);
+ if (old_sigsegv_handler)
+ old_sigsegv_handler(signum);
}
void sigabrt_handler(int signum)
BackTrace bt(0);
bt.print(*_dout);
- old_sigabrt_handler(signum);
+ //*_dout << "i am " << (void*)sigabrt_handler << ", chaining to " << (void*)old_sigabrt_handler << std::endl;
+ if (old_sigabrt_handler)
+ old_sigabrt_handler(signum);
}
#define _STR(x) #x
signal(SIGHUP, sighup_handler);
if (!old_sigsegv_handler)
old_sigsegv_handler = signal(SIGSEGV, sigsegv_handler);
- if (!old_sigabrt_handler)
+ if (!old_sigabrt_handler) {
old_sigabrt_handler = signal(SIGABRT, sigabrt_handler);
-
+ if (old_sigabrt_handler == sigabrt_handler)
+ old_sigabrt_handler = NULL;
+ //cout << "old_sigabrt_handler is " << (void*)old_sigabrt_handler << " new value is " << (void*)sigabrt_handler << std::endl;
+ } else {
+ //cout << "old_sigabrt_handler is " << (void*)old_sigabrt_handler << " didn't change" << std::endl;
+ }
args = nargs;
}