Handle SIGABRT

This commit is contained in:
Jack Andersen 2017-01-16 15:59:00 -10:00
parent b229c2f8fe
commit f913fb8479
1 changed files with 5 additions and 1 deletions

View File

@ -187,7 +187,8 @@ void logvisorAbort()
}
fflush(stderr);
abort();
fflush(stdout);
exit(1);
}
#endif
@ -202,6 +203,8 @@ static void AbortHandler(int signum)
Log.report(logvisor::Fatal, "Bad Execution");
case SIGFPE:
Log.report(logvisor::Fatal, "Floating Point Exception");
case SIGABRT:
Log.report(logvisor::Fatal, "Abort Signal");
default:
Log.report(logvisor::Fatal, "unknown signal %d", signum);
}
@ -452,6 +455,7 @@ void CreateWin32Console()
void RegisterStandardExceptions()
{
signal(SIGABRT, AbortHandler);
signal(SIGSEGV, AbortHandler);
signal(SIGILL, AbortHandler);
signal(SIGFPE, AbortHandler);