From 24f12dcf5828ee7ac0d18d4cbb1c6ed83ae500ae Mon Sep 17 00:00:00 2001 From: Andrew Hutchings Date: Mon, 12 Feb 2018 23:17:41 +0000 Subject: [PATCH] Fix sig handler for ExeMgr A bad merge for in MCOL-1085 means that ExeMgr is missing the crash handler. This adds it. --- exemgr/main.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/exemgr/main.cpp b/exemgr/main.cpp index b8def9813..8106afb73 100644 --- a/exemgr/main.cpp +++ b/exemgr/main.cpp @@ -1168,10 +1168,12 @@ public: } }; +#ifdef _MSC_VER void exit_(int) { exit(0); } +#endif void added_a_pm(int) { @@ -1216,7 +1218,6 @@ void printTotalUmMemory(int sig) void setupSignalHandlers() { #ifdef _MSC_VER - signal(SIGSEGV, exit_); signal(SIGINT, exit_); signal(SIGTERM, exit_); #else @@ -1232,6 +1233,11 @@ void setupSignalHandlers() sigaction(SIGHUP, &ign, 0); ign.sa_handler = printTotalUmMemory; sigaction(SIGUSR1, &ign, 0); + memset(&ign, 0, sizeof(ign)); + ign.sa_handler = fatalHandler; + sigaction(SIGSEGV, &ign, 0); + sigaction(SIGABRT, &ign, 0); + sigaction(SIGFPE, &ign, 0); #endif } @@ -1305,6 +1311,9 @@ int main(int argc, char* argv[]) string systemLang = "C"; systemLang = funcexp::utf8::idb_setlocale(); + // This is unset due to the way we start it + program_invocation_short_name = const_cast("ExeMgr"); + gDebug = 0; bool eFlg = false; int c;