浏览代码

Kernel: Ignore signals sent to threadless (zombie) processes

If a process doesn't have any threads left, it's in a zombie state and
we can't meaningfully send signals to it. So just ignore them.

Fixes #1313.
Andreas Kling 5 年之前
父节点
当前提交
4a293e8a21
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      Kernel/Process.cpp

+ 2 - 0
Kernel/Process.cpp

@@ -3719,6 +3719,8 @@ void Process::terminate_due_to_signal(u8 signal)
 void Process::send_signal(u8 signal, Process* sender)
 {
     InterruptDisabler disabler;
+    if (!m_thread_count)
+        return;
     auto* thread = Thread::from_tid(m_pid);
     if (!thread)
         thread = &any_thread();