1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 00:47:36 +00:00

Kernel: Fix signal delivery when no syscall is made

This fixes a regression introduced by the new software context
switching where the Kernel would not deliver a signal unless the
process is making system calls. This is because the TSS no longer
updates the CS value, so the scheduler never considered delivery
as the process always appeared to be in kernel mode. With software
context switching we can just set up the signal trampoline at
any time and when the processor returns back to user mode it'll
get executed. This should fix e.g. killing programs that are
stuck in some tight loop that doesn't make any system calls and
is only pre-empted by the timer interrupt.

Fixes #2958
This commit is contained in:
Tom 2020-08-02 12:08:22 -06:00 committed by Andreas Kling
parent 6e54d0c072
commit f011c420c1
4 changed files with 10 additions and 39 deletions

View file

@ -773,7 +773,7 @@ void Process::terminate_due_to_signal(u8 signal)
{
ASSERT_INTERRUPTS_DISABLED();
ASSERT(signal < 32);
dbg() << "Terminating due to signal " << signal;
dbg() << "Terminating " << *this << " due to signal " << signal;
m_termination_status = 0;
m_termination_signal = signal;
die();