Merge pull request #82163 from naelstrof/master

Made signal handling more uniform during crashes.
This commit is contained in:
Rémi Verschelde 2023-10-05 10:08:09 +02:00
commit d8ab953442
No known key found for this signature in database
GPG Key ID: C3336907360768E1
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;