Page MenuHomeFreeBSD

ptrace_test: add test for the PT_ATTACH behavior on sleeping thread
ClosedPublic

Authored by kib on Fri, Apr 18, 12:22 PM.
Tags
None
Referenced Files
F115058349: D49887.id153867.diff
Sun, Apr 20, 1:59 AM
F115051740: D49887.id153863.diff
Sun, Apr 20, 12:29 AM
F115049385: D49887.id.diff
Sat, Apr 19, 11:58 PM
F115039214: D49887.id153866.diff
Sat, Apr 19, 9:42 PM
F115027858: D49887.id153867.diff
Sat, Apr 19, 6:55 PM
F115025542: D49887.id153863.diff
Sat, Apr 19, 6:21 PM
F115025499: D49887.id.diff
Sat, Apr 19, 6:20 PM
F115025202: D49887.diff
Sat, Apr 19, 6:16 PM
Subscribers

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kib requested review of this revision.Fri, Apr 18, 12:22 PM
markj added inline comments.
tests/sys/kern/ptrace_test.c
4498

The error handling can just be ATF_REQUIRE(shm != MAP_FAILED);

This revision is now accepted and ready to land.Fri, Apr 18, 1:50 PM
kib marked an inline comment as done.

Use proper way to check the mmap failure.
Check nanosleep return value and errno.

This revision now requires review to proceed.Fri, Apr 18, 3:02 PM

Is there a way to skip the test depending on the sysctl value? Or should I do not bother?

In D49887#1137583, @kib wrote:

Is there a way to skip the test depending on the sysctl value? Or should I do not bother?

You can do something like

error = sysctlbyname(..., &val);
ATF_REQUIRE(error == 0);
if (val)
    atf_tc_skip(tc, "test doesn't work with sysctl foo set");

For a chicken switch under the debug MIB, I probably wouldn't bother.

tests/sys/kern/ptrace_test.c
4518

For completeness, also check that WEXITSTATUS(status) == 0?

kib marked an inline comment as done.

Check exit status of the child.

This revision is now accepted and ready to land.Fri, Apr 18, 3:22 PM