Kernel: Only call Process::die() once on terminating signal

Previously, when e.g. the `SIGABRT` signal was sent to a process,
`Thread::dispatch_signal()` would invoke
`Process::terminate_due_to_signal()` which would then `::die()`. The
result `DispatchSignalResult::Terminate` is then returned to
`Thread::check_dispatch_pending_signal()` which proceeds to invoke
`Process::die()` a second time.

Change the behavior of `::check_dispatch_pending_signal()` to no longer
call `Process::die()` if it receives `::Terminate` as a signal handling
result, since that indicates that the process was already terminated.

This fixes #7289.
This commit is contained in:
Jelle Raaijmakers 2021-06-14 15:32:32 +02:00 committed by Andreas Kling
parent 7ee73b3721
commit 5b03b62518
Notes: sideshowbarker 2024-07-18 12:14:54 +09:00

View file

@ -468,9 +468,6 @@ void Thread::check_dispatch_pending_signal()
case DispatchSignalResult::Yield:
yield_while_not_holding_big_lock();
break;
case DispatchSignalResult::Terminate:
process().die();
break;
default:
break;
}