Signals and exceptions are not related to each other. What you use (excluding exceptions from async signal handlers) is only transferred between several compilers that support it, such as GCC and Intel C / C ++ with -fnon-call-exceptions .
However, what you forgot to do is to unblock the signal: when the signal handler is executed, the delivery of the same signal is blocked and it will not be unlocked when the signal handler leaves the exception. Change the signal handler as follows:
void SigactionHookHandler( int iSignal, siginfo_t * psSiginfo, void * psContext { cout << "Signal Handler Exception Caught: std::exception -- signal : " << iSignal << " from SigactionHookHandler()" << endl; sigset_t x; sigemptyset (&x); sigaddset(&x, SIGSEGV); sigprocmask(SIG_UNBLOCK, &x, NULL); throw std::exception(); }
Cubbi source share