Made signal handling more uniform. Fixes #82102

This commit is contained in:
naelstrof 2023-09-22 19:29:53 -06:00
parent c12d63556b
commit b49e9c9896
2 changed files with 14 additions and 6 deletions

View File

@ -49,6 +49,10 @@
#include <stdlib.h>
static void handle_crash(int sig) {
signal(SIGSEGV, SIG_DFL);
signal(SIGFPE, SIG_DFL);
signal(SIGILL, SIG_DFL);
if (OS::get_singleton() == nullptr) {
abort();
}
@ -156,9 +160,9 @@ void CrashHandler::disable() {
}
#ifdef CRASH_HANDLER_ENABLED
signal(SIGSEGV, nullptr);
signal(SIGFPE, nullptr);
signal(SIGILL, nullptr);
signal(SIGSEGV, SIG_DFL);
signal(SIGFPE, SIG_DFL);
signal(SIGILL, SIG_DFL);
#endif
disabled = true;

View File

@ -72,6 +72,10 @@ static uint64_t load_address() {
}
static void handle_crash(int sig) {
signal(SIGSEGV, SIG_DFL);
signal(SIGFPE, SIG_DFL);
signal(SIGILL, SIG_DFL);
if (OS::get_singleton() == nullptr) {
abort();
}
@ -186,9 +190,9 @@ void CrashHandler::disable() {
}
#ifdef CRASH_HANDLER_ENABLED
signal(SIGSEGV, nullptr);
signal(SIGFPE, nullptr);
signal(SIGILL, nullptr);
signal(SIGSEGV, SIG_DFL);
signal(SIGFPE, SIG_DFL);
signal(SIGILL, SIG_DFL);
#endif
disabled = true;