Skip to content

Commit

Permalink
Fix usage on FreeBSD after c6f10c6
Browse files Browse the repository at this point in the history
This commit added a ptrace_wait to reap the dummy before
ptrace_detach_child.  On FreeBSD, this leaves us stuck waiting on a child
that cannot be reaped because ptrace is still attached.

Signed-off-by: Kyle Evans <[email protected]>
  • Loading branch information
kevans91 committed Nov 23, 2019
1 parent d2b0b06 commit 1c08244
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion attach.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ int do_setsid(struct ptrace_child *child) {

out_kill:
kill(dummy.pid, SIGKILL);
ptrace_wait(&dummy);
ptrace_detach_child(&dummy);
ptrace_wait(&dummy);
do_syscall(child, wait4, dummy.pid, 0, WNOHANG, 0, 0, 0);
return err;
}
Expand Down

0 comments on commit 1c08244

Please sign in to comment.