Repository navigation
test(libSceAgcDriver): check the sampled caller through native unwind data on SEH toolchains - #24354
Conversation
… data on SEH toolchains The process sampler stack fixture has no .pdata only when the libraries build with -fno-asynchronous-unwind-tables (DWARF exceptions, WinLibs). With an SEH toolchain such as MSYS2 UCRT64 GCC every function has .pdata, so the test stopped before checking the sampler. On SEH builds, require the native unwind entry and check the caller through it; DWARF builds keep requiring its absence. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
Nothing blocks this change; the available evidence supports the compiler-specific fixture expectation.
What I ran
Reviewed head d36d0c84b0845a24af1dec4008e226a941831f65 and its prepared diff. No commands or tests were run.
Results
| Check | Result | Note |
|---|---|---|
| Diff and changed source | passed | One test file read |
| Tests | not run | Author reports CI and local runs |
Findings
Blocking
None.
Non-blocking
None.
Not verified
Did not independently run the Windows test or verify the reported CI results. Reviewed core/libs/prx/libSceAgcDriver/tests/ProcessSamplerStack.cpp; manifest.json lists this as the only changed file and marks its full text included. No files were excluded in the supplied manifest.
To get this to a good state
Nothing is required.
|
Tested head Setup: Windows 11 Pro 10.0.26200, Ryzen 7 9800X3D, WinLibs GCC 15.2.0 r7, Release,
Whole batch: the full This is one combined tree, not a run of this PR alone. AI-assisted: yes (Claude Code) |
|
Windows run on the toolchain this change targets: on Setup: Windows 11 Enterprise 10.0.26300, Ryzen 7 9800X3D, MSYS2 UCRT64 GCC 16.2.0 (Rev7), cmake 4.5, Ninja, Release,
AI-assisted: yes |
|
An isolated WinLibs control for the MSYS2 report in #25167. On Windows 11 build 26300 with WinLibs GCC 15.2.0 r7, the project’s
I rebuilt the fixture and sampler with the project’s Release compile and link settings. Both builds shared the same existing test wrappers and |
|
The Windows MSYS2 nightly has failed on Until 20 November This PR makes the test pass on MSYS2 UCRT64 GCC 16.2.0: 10/10 in my runs with #24502 and this PR on
AI-assisted: yes |
mihiii1337
left a comment
There was a problem hiding this comment.
Reviewed exact head d36d0c84b0845a24af1dec4008e226a941831f65 with a new native Windows-SEH control.
I compiled the exact test and WorkerSampler sources in Release with WinLibs GCC 15.2, linked them directly to the existing hashed runtime libraries, and confirmed the object uses the native SEH form (__SEH__, .pdata/.xdata). The full sampler test passed 43 checks, including the caller-frame samples that the current main test refuses when it sees native Windows unwind metadata. The corresponding DWARF control remains covered separately.
This is deliberately not a new MSYS2 build. The independent MSYS2 A/B already reported 0/3 on old main and 3/3 on this change, and the latest main MSYS2 nightly still reproduces fixture unexpectedly has native Windows unwind metadata; I am not claiming those runs as mine. The exact-head Hosted Windows job is green with the test executed; Hosted Linux was skipped. No GPU path was involved.
#26061's conditional skip is mechanically correct, but this PR is preferable because it preserves and exercises SEH stack-walk coverage rather than skipping it. Within that scope I found no remaining blocker. This approval is limited to the exact commit above.
AI-assisted: yes
What
agc_process_sampler_stackfails on every Windows build with an SEH toolchain (MSYS2 UCRT64 GCC) before it checks the sampler:fixture unexpectedly has native Windows unwind metadata. The check came with #13131. It requiresBusyto have noRUNTIME_FUNCTION, so the walk takes the.ehframpath. That holds only whencore/libs/CMakeLists.txtadds-fno-asynchronous-unwind-tables, which it does for DWARF exceptions (WinLibs). With an SEH toolchain every function has.pdata.The test now branches on
__SEH__, ascore/libs/tests/GuestModuleInfo.cppdoes. On SEH builds it requires the fixture's native unwind entry and checks the caller throughRtlVirtualUnwind. DWARF builds keep the same check and message as before (-fno-asynchronous-unwind-tablesleaves__SEH__undefined), so the.ehframwalk stays covered by the WinLibs job. The sampler code is the same on both toolchains, so there is no debt entry.CI on
main:windowsjob of themainpush build at 0a025bd, passing: job.Tested
Windows 11 Pro 26H2 (10.0.26300), MSYS2 UCRT64 GCC 16.2.0-7, Release; WinLibs not tested locally, CI covers it.
agc_process_sampler_stackfails onmainand passes 10 of 10 runs with this change (ctest --repeat until-fail:10), 44 to 45 inclusive caller samples each.NativeUnwindFixtureistrueat-O3andfalsewith-fno-asynchronous-unwind-tables, the flag DWARF builds use.tools/select_tests.pyselected 1135 tests; all pass with--timeout 120.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)