1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:27:35 +00:00

Kernel: Don't send crash signal to process itself when it has no handler

If there's nobody listening for the crash signal, fall back to the
normal crash path where we get some debug output about what happened.

Thanks to Idan for suggesting the fix.
This commit is contained in:
Andreas Kling 2022-01-24 17:16:52 +01:00
parent 2b3790100a
commit e04e52186d

View file

@ -220,7 +220,7 @@ void handle_crash(RegisterState const& regs, char const* description, int signal
PANIC("{} with !Thread::current()", description);
auto crashed_in_kernel = (regs.cs & 3) == 0;
if (!crashed_in_kernel && !current_thread->should_ignore_signal(signal) && !current_thread->is_signal_masked(signal)) {
if (!crashed_in_kernel && current_thread->has_signal_handler(signal) && !current_thread->should_ignore_signal(signal) && !current_thread->is_signal_masked(signal)) {
current_thread->send_urgent_signal_to_self(signal);
return;
}