fix(tests): run guest_main_stack without the ASan fake stack #16089
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/16089"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-11-05T16:28:17Z.
What
The
guest_main_stackandguest_main_stack_adoptedtests fail in the Sanitizers nightly of 2026-11-04 (head1c8c0efc8c) withGuestMainStack failed at line 68. Under ASan the test's locallocal(GuestMainStack.cpp:61), whose address is passed tosceKernelIsStack, can sit on ASan's fake stack (detect_stack_use_after_return), which is outside the guest main stack.sceKernelIsStackthen returns 0 withstartandendleft at 0; printing the values before line 68 gavelow=0 high=0and an address in the host's fake-stack range instead of0x1007eeffc000, so thehigh == ConsoleMainStackTopcheck fails.The sibling tests that take stack addresses (
guest_kernel_is_stack,guest_kernel_stack_protect,guest_thread_self,guest_pthread_stack,guest_raise_exception) already registeradd_asan_test_options(<test> detect_stack_use_after_return=0). This PR adds the same line for the twoguest_main_stacktests. It is not caused by #15436: the test file from before #15436 fails the same way against current production code.Changes one file,
core/libs/prx/libkernel/CMakeLists.txt(+2).Tested
ANYPS5_ENABLE_ASAN=ONwith-g1 -fsanitize=undefined -fno-sanitize=vptr,ASAN_OPTIONS=detect_leaks=0,UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1,APS5_SKIP_TIMING_TESTS=1, as insanitizers.yml.1c8c0efc8c, tests unchanged (red): both tests failed in 3 of 3 runs. Withdetect_stack_use_after_return=0added toASAN_OPTIONS: passed in 3 of 3 runs. With this change: passed in 3 of 3 runs, andctest -VshowsASAN_OPTIONS=string_append::detect_stack_use_after_return=0.a992b80376(fresh checkout, cmake and ninja exited 0, build 416 s), tests unchanged (red): both failed in 3 of 3 runs. With this change applied as a patch, rebuilt: passed in 3 of 3 runs. The three files this PR and the tests depend on (libkernel/CMakeLists.txt,GuestMainStack.cpp,Thread.cpp) are identical betweena992b80376and the based63781e9ceof this commit.detect_leaks=0only: failed in 2 of 2 runs at line 68.python -I tools/check_conventions.py --base upstream/mainpassed andgit diff --checkis clean.libkernel/CMakeLists.txt).Overlap
All 1845 open pull requests were checked on 2026-11-05 at 14:43 UTC against main
03cfa4c067; the changed files of each PR come fromgit diff --name-onlyagainst its merge base, finished 16:05 UTC. 49 PRs changecore/libs/prx/libkernel/CMakeLists.txtorcore/libs/tests/GuestMainStack.cpp, and every one had a fetchable ref. For each,git merge-treewith this head and withmainalone gives the same result for 47 of them (30 merge cleanly either way, 17 already conflict withmainon their own); the other 2 conflict withmainalone but merge cleanly with this head. No PR conflicts only because of this change. #15691 changesGuestMainStack.cppandThread.cpp; it merges cleanly with this head and withmain. This head merges cleanly withmain4741457fed(git merge-treeexit 0). Depends on: none.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)AI-assisted (Claude Code).
🤖 Generated with Claude Code