test(libkernel): run guest_exception_fault with ASan's SEGV handler off #16070
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/16070"
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-05T14:28:00Z.
What
guest_exception_faultfails in the nightly Sanitizers run of 2026-11-05 (run 41963336767), the first nightly after #7192 (merged 2026-11-04 19:19 UTC) added it: the test ends withSubprocess aborted, and its output carriesAddressSanitizer: SEGV on unknown address 0x000000000010.TestRemoveAndReturnstarts the test program again as a child. The child installs a handler, the handler removes itself, and the child then reads address0x10, which faults. The parent requires the child to die bySIGSEGV(WIFSIGNALED(status) && WTERMSIG(status) == SIGSEGV,GuestExceptionFault.cpp:558). Once the handler is gone,ChainFault(Exception.cpp:1231-1247) passes the fault to the previously installed handler. Under ASan that is ASan's own SEGV handler, which prints its report and exits with code 1, so the child does not die by a signal and the check fails.This PR adds
add_asan_test_options(guest_exception_fault handle_segv=0)after the test'sTIMEOUTline incore/libs/prx/libkernel/CMakeLists.txt. In ASan builds ASan then does not install its SEGV handler for this test, and the child dies bySIGSEGVas the test expects. The consequence, stated plainly: ASan does not report a SEGV inside this one test. Its other checks and every other test stay as they are, and nothing changes outside ASan builds. The helper is the one that already setsdetect_stack_use_after_return=0for neighbouring tests; there is no earlier use ofhandle_segv.The other tests that expect a child to die by
SIGSEGVorSIGBUS(WriteWatch.cpp,WriteWatchBacking.cpp,GuestArenaHost.cpp) are only registeredif(APPLE)(core/libs/CMakeLists.txt:631-634), so no other Linux test hits this. I did not take two other routes. Skipping the check underANYPS5_ENABLE_ASAN, asGuestGetrlimit.cppdoes for one of its tests, would drop the check from the sanitizer job. ChangingChainFaultis not needed for this failure, and I leftException.cppalone.Tested
Ubuntu 24.04, GCC 13.3, ASan + UBSan configured as in
sanitizers.yml,ASAN_OPTIONS=detect_leaks=0, onmaine772fb25cc72ee5faf77847f06bbc69533016e82:guest_exception_faultfailed in 3 of 3 runs (Subprocess aborted). Running the child directly (guest_exception_fault_tests remove-and-return) exited with 1 and printedAddressSanitizer: SEGV on unknown address 0x000000000010; withASAN_OPTIONS=detect_leaks=0:handle_segv=0it exited with 139 (SIGSEGV) and the test passed in 3 of 3 runs.ctestlists the environment modification for the test.libkernel/CMakeLists.txtfrom main (red):Subprocess abortedin 3 of 3 runs.python -I tools/check_conventions.py --base e772fb25cc72ee5faf77847f06bbc69533016e82passed;git diff --checkis clean.Not run: Windows and macOS. The helper only acts when
ANYPS5_ENABLE_ASANis on, which the build allows on Linux only.Overlap
Checked against main
e772fb25ccwith the 1815 open PRs listed at 12:19 UTC on 2026-11-05 (scan from 12:17 UTC to 13:24 UTC); the changed files of each PR come fromgit diff --name-onlyagainst its merge base. 47 PRs changecore/libs/prx/libkernel/CMakeLists.txtand none changescore/libs/tests/GuestExceptionFault.cpp. Measured against this head withgit merge-tree: 29 are clean. The other 18 also conflict with main alone, so this PR does not cause any of them. No open PR mentionsguest_exception_fault,handle_segvorChainFault, and #7192 has no open follow-up. The branch is based one772fb25cc; against current maind23df92b3805fea21493a73cbed8835c9e8548d0(checked on 2026-11-05 at 13:26 UTC) it merges cleanly. None of the pull requests opened after that listing, up to 14:25 UTC, changes either file. 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