mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
Kernel: Terminate current thread immediately on unhandled urgent signal
If we're sending an urgent signal (i.e. due to unexpected conditions) and the Process did not setup any signal handler, we should immediately terminate the Thread, to ensure the current trap frame is preserved for the impending core dump.
This commit is contained in:
parent
971b3645ef
commit
548488f050
Notes:
sideshowbarker
2024-07-17 23:06:24 +09:00
Author: https://github.com/IdanHo Commit: https://github.com/SerenityOS/serenity/commit/548488f0509 Pull-request: https://github.com/SerenityOS/serenity/pull/11175 Reviewed-by: https://github.com/BertalanD ✅
1 changed files with 4 additions and 0 deletions
|
@ -701,6 +701,10 @@ void Thread::send_urgent_signal_to_self(u8 signal)
|
|||
SpinlockLocker lock(g_scheduler_lock);
|
||||
result = dispatch_signal(signal);
|
||||
}
|
||||
if (result == DispatchSignalResult::Terminate) {
|
||||
Thread::current()->die_if_needed();
|
||||
VERIFY_NOT_REACHED(); // dispatch_signal will request termination of the thread, so the above call should never return
|
||||
}
|
||||
if (result == DispatchSignalResult::Yield)
|
||||
yield_and_release_relock_big_lock();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue