Tested versions
4.7
System information
Windows 11, Ubuntu 26.04
Issue description
This is mainly an issue with libgodot but the CrashHandlers for Windows and Linux will not restore previous signal handlers when disabled. Since they can not be disabled before initializing godot and will always set their own signal handlers it is currently impossible to setup custom crash handling beforehand with something like breakpad.
|
void CrashHandler::disable() { |
|
if (disabled) { |
|
return; |
|
} |
|
|
|
#if defined(CRASH_HANDLER_EXCEPTION) |
|
signal(SIGSEGV, nullptr); |
|
signal(SIGFPE, nullptr); |
|
signal(SIGILL, nullptr); |
|
#endif |
|
|
|
disabled = true; |
|
} |
|
|
|
void CrashHandler::initialize() { |
|
#if defined(CRASH_HANDLER_EXCEPTION) |
|
signal(SIGSEGV, CrashHandlerException); |
|
signal(SIGFPE, CrashHandlerException); |
|
signal(SIGILL, CrashHandlerException); |
|
#endif |
|
} |
|
void CrashHandler::disable() { |
|
if (disabled) { |
|
return; |
|
} |
|
|
|
#ifdef CRASH_HANDLER_ENABLED |
|
signal(SIGSEGV, SIG_DFL); |
|
signal(SIGFPE, SIG_DFL); |
|
signal(SIGILL, SIG_DFL); |
|
#endif |
|
|
|
disabled = true; |
|
} |
|
|
|
void CrashHandler::initialize() { |
|
#ifdef CRASH_HANDLER_ENABLED |
|
signal(SIGSEGV, handle_crash); |
|
signal(SIGFPE, handle_crash); |
|
signal(SIGILL, handle_crash); |
|
#endif |
|
} |
Steps to reproduce
init_breakpad();
const auto instance = static_cast<GodotInstance*>(libgodot_create_godot_instance(argc, argv, gdextension_init));
OS::get_singleton()->disable_crash_handler();
CRASH_NOW();
Minimal reproduction project (MRP)
Tested versions
4.7
System information
Windows 11, Ubuntu 26.04
Issue description
This is mainly an issue with libgodot but the CrashHandlers for Windows and Linux will not restore previous signal handlers when disabled. Since they can not be disabled before initializing godot and will always set their own signal handlers it is currently impossible to setup custom crash handling beforehand with something like breakpad.
godot/platform/windows/crash_handler_windows_signal.cpp
Lines 307 to 327 in 8c7e6c5
godot/platform/linuxbsd/crash_handler_linuxbsd.cpp
Lines 259 to 279 in 8c7e6c5
Steps to reproduce
Minimal reproduction project (MRP)