summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelle Raaijmakers <jelle@gmta.nl>2021-06-14 15:32:32 +0200
committerAndreas Kling <kling@serenityos.org>2021-06-14 16:27:37 +0200
commit5b03b62518ac1fcfaf67d1cd308d1e089efc655e (patch)
tree59170848024b56ebe797d9a7317c5c0c1b99c58b
parent7ee73b372126ad091dd9cbfb879415d8e8e62591 (diff)
downloadserenity-5b03b62518ac1fcfaf67d1cd308d1e089efc655e.zip
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.
-rw-r--r--Kernel/Thread.cpp3
1 files changed, 0 insertions, 3 deletions
diff --git a/Kernel/Thread.cpp b/Kernel/Thread.cpp
index 9025730002..87be0a1a48 100644
--- a/Kernel/Thread.cpp
+++ b/Kernel/Thread.cpp
@@ -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;
}