Browse Source

Re-raise signal that triggered signal handler.

tags/v2.0.6
Andrew Belt 2 years ago
parent
commit
7d903e70de
1 changed files with 3 additions and 13 deletions
  1. +3
    -13
      adapters/standalone.cpp

+ 3
- 13
adapters/standalone.cpp View File

@@ -28,7 +28,6 @@
#include <thread> #include <thread>
#include <unistd.h> // for getopt #include <unistd.h> // for getopt
#include <signal.h> // for signal #include <signal.h> // for signal
#include <string.h> // for sys_siglist
#if defined ARCH_WIN #if defined ARCH_WIN
#include <windows.h> // for CreateMutex #include <windows.h> // for CreateMutex
#endif #endif
@@ -45,21 +44,12 @@ using namespace rack;
static void fatalSignalHandler(int sig) { static void fatalSignalHandler(int sig) {
// Ignore this signal to avoid recursion. // Ignore this signal to avoid recursion.
signal(sig, NULL); signal(sig, NULL);
// Ignore abort() since we call it below.
signal(SIGABRT, NULL);


#if defined ARCH_LIN
const char* sigNameC = strsignal(sig);
#elif defined ARCH_MAC
const char* sigNameC = sys_siglist[sig];
#else
const char* sigNameC = "";
#endif
std::string sigName = "SIG" + string::uppercase(sigNameC);
std::string stackTrace = system::getStackTrace(); std::string stackTrace = system::getStackTrace();
FATAL("Fatal signal %d %s. Stack trace:\n%s", sig, sigName.c_str(), stackTrace.c_str());
FATAL("Fatal signal %d. Stack trace:\n%s", sig, stackTrace.c_str());


abort();
// Re-raise signal
raise(sig);
} }






Loading…
Cancel
Save