Repository navigation
fix(libc): list stack return address candidates in Windows backtrace reports - #3887
Merged
adriadam10 merged 2 commits intoOct 11, 2026
Conversation
…reports The abort() and UCRT invalid-parameter reports capture the stack with RtlCaptureStackBackTrace, which stops at the first frame without unwind data (guest code, or our libraries built without asynchronous unwind tables), so they often end two or three frames in, before any caller. The fault report already scans the stack for code addresses; that scan is now a helper the backtrace reports use as well. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
9 tasks done
Collaborator
|
Checked the diff: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
On Windows, the
abort()and UCRT invalid-parameter reports (ReportBacktraceinCrashReport.cpp) capture the stack withRtlCaptureStackBackTrace. That stops at the first frame without unwind data: guest code, or our own.prxlibraries, which are built with-fno-asynchronous-unwind-tables. So these reports usually end two or three frames in, before reaching any caller. The fault report (ReportCrash) already scans the stack for code addresses ("stack return address candidates"). This PR moves that scan into a helper.ReportCrashuses it unchanged (16 entries over 0x2000 bytes), andReportBacktracenow uses it too, with 32 entries over 0x4000 bytes, since it starts inside our handler and the UCRT's frames.Where it matters: catalog titles that abort on Windows. On
maina11c8f7, ProsperoTV (PPSA99003) aborts on thepollthrow (#3584) and its report ends with:There's no guest frame, so the guest call site has to be found another way. ProsperoLight (PPSA99002), on
mainplus open PRs for its earlier stops, reportsFATAL: UCRT invalid parameterwith onlylibc.prx+0xa9e7,libc.prx+0x9f492and a stack address. With the scan, the same report lists thelibSceNet.prx,libkernel.prxandapp.exereturn addresses above it, which is how I narrowed it down. That stop isn't onmainyet, so I'm not filing it here.The test's own output with this change:
Tested
Windows 11 (26200), WinLibs GCC 15.2.0 r7, Release,
maina11c8f7:windows_backtrace_reporttest (Windows only). A process that loadslibc.prxcallsabort(), and CTest'sPASS_REGULAR_EXPRESSIONrequiresstack return address candidates:with anrsp+0xline after theFATAL: abort() (SIGABRT)line. It fails with theCrashReport.cppchange reverted and passes with it. (It goes throughabort()because a MinGW executable's start-up code installs its own invalid-parameter handler over libc's; relinked titles don't run that code.)ctest -E "^agc_|video_out": 451/454. The 3 failures also fail onmainon Windows:windows_exceptions(Windows: windows_exceptions fails since #1423, unwinding through runtime DLL frames (std::call_once) no longer reaches the catch #3411),guest_kernel_sys(fix(libkernel_sys): create symlinks with CreateSymbolicLinkW on Windows #3510) andguest_filesystem(test(libkernel): don't require restoring the directory time on Windows #3518).guest_exception_*pass.tools/check_conventions.pyandtools/pr_overlap.py: clean. The helper sits besideReportBacktrace, away from fix(libc): emulate faulting BMI2 shifts on Windows #3746's hunk in the same file.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code