ptrace_test PT_SC_REMOTE: fix a race
Only one of PT_TRACE_ME/PT_ATTACH is needed. Having them both causes the race between parent and child on the attachment way. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D49678
This commit is contained in:
@@ -4378,7 +4378,10 @@ ATF_TC_BODY(ptrace__PT_SC_REMOTE_getpid, tc)
|
||||
exit(0);
|
||||
}
|
||||
|
||||
attach_child(fpid);
|
||||
wpid = waitpid(fpid, &status, 0);
|
||||
REQUIRE_EQ(wpid, fpid);
|
||||
ATF_REQUIRE(WIFSTOPPED(status));
|
||||
REQUIRE_EQ(WSTOPSIG(status), SIGSTOP);
|
||||
|
||||
pscr.pscr_syscall = SYS_getpid;
|
||||
pscr.pscr_nargs = 0;
|
||||
|
||||
Reference in New Issue
Block a user