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