From 27fded7002c31c8f323fa2c07d80955281c25997 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 8 Nov 2018 00:07:56 +0100 Subject: [PATCH] Unbreak signal delivery to userspace again. My my, this code is quite fickle. --- Kernel/Process.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp index 3f308334ea8..c7ecaa01be0 100644 --- a/Kernel/Process.cpp +++ b/Kernel/Process.cpp @@ -21,7 +21,7 @@ //#define DEBUG_IO //#define TASK_DEBUG //#define FORK_DEBUG -//#define SIGNAL_DEBUG +#define SIGNAL_DEBUG #define MAX_PROCESS_GIDS 32 // FIXME: Only do a single validation for accesses that don't span multiple pages. @@ -805,6 +805,9 @@ void Process::dispatch_signal(byte signal) m_pending_signals &= ~(1 << signal); + // FIXME: This state is such a hack. It avoids trouble if 'current' is the process receiving a signal. + set_state(Skip1SchedulerPass); + #ifdef SIGNAL_DEBUG dbgprintf("signal: Okay, %s(%u) {%s} has been primed with signal handler %w:%x\n", name().characters(), pid(), toString(state()), m_tss.cs, m_tss.eip); #endif