Page MenuHomeFreeBSD

tests: Add stack grows tests
ClosedPublic

Authored by dchagin on Aug 4 2023, 12:46 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Apr 29, 9:40 PM
Unknown Object (File)
Wed, Apr 17, 2:32 PM
Unknown Object (File)
Wed, Apr 17, 10:43 AM
Unknown Object (File)
Wed, Apr 17, 10:42 AM
Unknown Object (File)
Wed, Apr 17, 10:42 AM
Unknown Object (File)
Wed, Apr 17, 10:37 AM
Unknown Object (File)
Wed, Apr 17, 10:37 AM
Unknown Object (File)
Wed, Apr 17, 10:13 AM

Details

Summary

There's a depedndency stack_dt_need_test:soxstack issue that I don't understand how to fix properly

Diff Detail

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

Event Timeline

dchagin retitled this revision from tests: Add stack grows tests There's a depedndency stack_dt_need_test:soxstack issue that I don't understand how to fix properly to tests: Add stack grows tests.Aug 4 2023, 12:47 PM
dchagin edited the summary of this revision. (Show Details)
dchagin added reviewers: kib, jrtc27.

I am not sure what your trouble is, but if it is about having the dependency .dso built before the test program, try to look at libexec/rtld-elf/tests/Makefile. Specifically SUBDIR_DEPEND_target= XXX.

dchagin edited the summary of this revision. (Show Details)

John Carr test added

In D41320#941149, @kib wrote:

I am not sure what your trouble is, but if it is about having the dependency .dso built before the test program, try to look at libexec/rtld-elf/tests/Makefile. Specifically SUBDIR_DEPEND_target= XXX.

It works only in case when the _target is a directory

In D41320#941149, @kib wrote:

I am not sure what your trouble is, but if it is about having the dependency .dso built before the test program, try to look at libexec/rtld-elf/tests/Makefile. Specifically SUBDIR_DEPEND_target= XXX.

It works only in case when the _target is a directory

Put .WAIT in SUBDIR before them

Move stack tests to a separate directory under tests/sys/vm

tests/sys/vm/stack/stack_mprotect_exec_test.c
33

Does this magic value depend on the generated code? Same question about the arch.

In other words, would the test require tweaking for each compiler import?

well, that's was John's test case, adapted to atf. I agree, that te test was a bit clumsy,
so, slightly rework it. AFAIU, the test changes the protection bits of the last page in the mmaped
stack area, then touches next page to gen PF.

well, that's was John's test case, adapted to atf. I agree, that te test was a bit clumsy,
so, slightly rework it. AFAIU, the test changes the protection bits of the last page in the mmaped
stack area, then touches next page to gen PF.

Exactly, so removing the magic 0x20, which is apparently not needed, is only good.

This revision is now accepted and ready to land.Aug 6 2023, 10:12 PM
tests/sys/vm/Makefile
21

Why is this in SUBDIR rather than TESTS_SUBDIRS? Though now the library is in a subdir just use the normal SUBDIR_DEPENDS_?

tests/sys/vm/Makefile
21

Just a leftover after .WAIT experiments, will fix. Looks like SUBDIR_DEPENDS_ works only if _target is a directory

This revision now requires review to proceed.Aug 7 2023, 2:13 PM
This revision was not accepted when it landed; it landed in state Needs Review.Aug 8 2023, 3:12 PM
This revision was automatically updated to reflect the committed changes.

At the end of a full build which just terminated:

ld: error: unable to find library -lsoxstack
clang: error: linker command failed with exit code 1 (use -v to see invocation)
--- stack_dt_need_exec_test.full ---
*** [stack_dt_need_exec_test.full] Error code 1

Looks like this broke the build.

Rebuild with 8920c5f2a11 reverted succeeded. Looks like D41320. The host is FreeBSD 13.2p2 with minimal extras.

Rebuild with 8920c5f2a11 reverted succeeded. Looks like D41320. The host is FreeBSD 13.2p2 with minimal extras.

try 76f28f65, thanks.