Question 12: Zombie Process Which of the following statements are correct?
MathWorks technical mcq question, verified with a worked answer. Free to practise - no sign-up.
Question 12: Zombie Process
Which of the following statements are correct?
- Zombie process can be killed by SIGKILL
- Zombie can be removed when parent calls wait()
- Zombie is created when a child terminates before the parent performs a wait.
Show answer & explanation
Statement 1 is false: zombie processes cannot be killed by SIGKILL because they are already dead—the process has terminated but its entry remains in the process table. Statements 2 and 3 are correct: zombies are created when a child terminates but the parent hasn't called wait() to reap it, and calling wait() removes the zombie entry from the process table.
Step-by-step Derivation:
Evaluate each statement:
Statement 1 - FALSE: A zombie process is already terminated. SIGKILL cannot kill what is already dead. The kernel maintains a minimal process table entry only to allow the parent to retrieve the child's exit status. No signal can affect a zombie.
Statement 2 - TRUE: When a parent process calls wait() or waitpid(), it retrieves the child's exit status and the kernel removes the zombie entry from the process table, cleaning up all remaining resources.
Statement 3 - TRUE: This is the definition of a zombie process. It occurs when a child process terminates via exit() or return, but the parent process has not yet called wait() to collect the child's exit status. The child becomes a zombie until the parent reaps it or the parent terminates (then init/PID 1 reaps it).
Correct statements: 2 and 3 → Answer is B.