Skip to content
Snippets Groups Projects
Verified Commit 24ecd6ee authored by Jacob Lorentzon's avatar Jacob Lorentzon
Browse files

Fix waitpid deadlock.

parent 8ac0626b
No related branches found
No related tags found
No related merge requests found
......@@ -228,6 +228,12 @@ fn fork_inner(initial_rsp: *mut usize) -> Result<usize> {
// Unblock context.
syscall::kill(new_pid, SIGCONT)?;
// XXX: Killing with SIGCONT will put (pid, 65536) at key (pid, pgid) into the waitpid of this
// context. This means that if pgid is changed (as it is in ion for example), the pgid message
// in syscall::exit() will not be inserted as the key comparator thinks they're equal as their
// PIDs are. So, we have to call this to clear the waitpid queue to prevent deadlocks.
let _ = syscall::waitpid(new_pid, &mut 0, syscall::WUNTRACED | syscall::WCONTINUED);
Ok(new_pid)
}
#[no_mangle]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment