From 5b03b62518ac1fcfaf67d1cd308d1e089efc655e Mon Sep 17 00:00:00 2001 From: Jelle Raaijmakers Date: Mon, 14 Jun 2021 15:32:32 +0200 Subject: [PATCH] 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. --- Kernel/Thread.cpp | 3 --- 1 file changed, 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; }