diff --git a/server/core/gateway.cc b/server/core/gateway.cc index 3482315fb..91da2c46d 100644 --- a/server/core/gateway.cc +++ b/server/core/gateway.cc @@ -493,12 +493,12 @@ void extract_file_and_line(const char* symbols, char* cmd, size_t size) static void sigfatal_handler(int i) { - if (fatal_handling) - { - fprintf(stderr, "Fatal signal %d while backtracing\n", i); - _exit(1); - } - fatal_handling = 1; + // The same signal being handled *now* can occur in another thread (and is often likely). + // By setting the default handler here we will always get a core, but not necessarily + // the backtrace into the log file. This should be overhauled to proper signal handling + // (MXS-599). + signal_set(i, SIG_DFL); + MXS_CONFIG* cnf = config_get_global_options(); fprintf(stderr, "Fatal: MaxScale " MAXSCALE_VERSION " received fatal signal %d. " "Attempting backtrace.\n", i); @@ -539,7 +539,6 @@ sigfatal_handler(int i) /* re-raise signal to enforce core dump */ fprintf(stderr, "\n\nWriting core dump\n"); - signal_set(i, SIG_DFL); raise(i); }