Windows: windows_exceptions fails since #1423, unwinding through runtime DLL frames (std::call_once) no longer reaches the catch #3411
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 screamm on 2026-10-11T09:48:34Z.
Since #1423 (
3ac63a6d, "key the .eh_frame index on the image, drop the VirtualQuery fallback, test unwinding through runtime DLLs", merged 2026-10-11 09:16)windows_exceptionsfails on this Windows host, deterministically (3/3 and in two full suite runs):That is the new
testUnwindThroughRuntimeModulescase: the exception thrown from thestd::call_oncelambda (frames inlibstdc++-6.dll/libwinpthread-1.dll) is not caught by the test'scatch (const std::runtime_error&)at depth 0, so the unwinder stops at the runtime DLL frames. The earlier cases in the same executable (TestTypeInfoVtables, exception pointers, futures, uncaught exceptions) pass. Built onmain0490ca18(plus an unrelated libSceAjm change in one run, none in the other); the same executable passed onmain0c617bae, before #1423.Windows 11 Pro 26220, WinLibs MinGW-w64 GCC 15.2.0 r7 (
15.2.0posix-14.0.0-ucrt-r7), Ninja, Release,BUILD_TESTING=ON. The runtime DLLs next to the test (build/tests/libstdc++-6.dll,libwinpthread-1.dll) are byte-identical to the toolchain'smingw64/bincopies. No completed CI run onmainsince that merge yet (the last ones were cancelled by newer pushes), so I cannot say whether the CI runner sees the same.Happy to run a diagnostic build (for example printing which module the new image-keyed
.eh_frameindex resolves for the faulting frames) if that helps.Written with Claude Code assistance.
Imported from boykopovar/AnyPS5. Originally posted by reyani-dev on 2026-10-11T09:59:54Z.
Same result here (Windows 11, WinLibs GCC 15.2.0 r7, RTX 4070 machine). Bisected on
main:3e1fa82cpasses andbf5458b7(the #1423 merge) fails.I think the cause is the new test, not the index. #1423 added
testUnwindThroughRuntimeModules, and those runtime frames have no DWARF unwind data:WinLibs' x86_64 runtime DLLs unwind with SEH (
.pdata/.xdata); their.eh_frameis an empty 4-byte terminator. With the posix thread model,std::call_onceruns the lambda from insidepthread_onceinlibwinpthread-1.dll, so the exception has to pass a frame that only has SEH data. On Windows,DecodeFrameonly reads.ehmetaand.ehframsections, the namescore/libs/CMakeLists.txtgives the repository's own libraries with--rename-section .eh_frame=.ehfram. Even a DLL with a real.eh_frame(8-byte name.eh_fram) wouldn't be read. So no FDE is found for thepthread_onceframe, the walk stops, and the exception is reported as unhandled.That would also explain why it can pass elsewhere: with a thread model where
call_oncedoesn't go through a separate C runtime frame (or with that runtime built with DWARF unwind tables), the new test never crosses a frame without an FDE.So making the test pass on WinLibs needs the Windows unwinder to step over frames that only have SEH data, for example
RtlLookupFunctionEntry+RtlVirtualUnwindto recover the caller's context. Alternatively, the test should throw through a frame that has unwind data the walker reads. Happy to try either once someone who knows the intended scope says which.Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-11T10:28:45Z.
Independent Windows reproduction and Math.cpp control (2026-10-11, a73)
Reproduced on Windows/WinLibs MinGW-w64 GCC15.2 r7/Release/BUILD_TESTING=ON. On main
a73a1af9plus only four min/max exports/tests, windows_exceptions fails in the full823-test run and a serial isolated run. Replacing only Math.cpp with exact unmodified a73 source, rebuilding native libc and keeping the same test executables/other DLLs gives the same serial failure:Focused serial failure0.125418s; baseline-Math control0.119254s. A separate a73 math+locale integration full run also fails here. This rules out needing the added min/max wrappers to reproduce the symptom on this host; it is not a bisect of #1423 or an independent root-cause confirmation. We have not validated #3415 yet. Logs, native-DLL hashes and source control are retained outside the repository. AI-assisted validation/report: Codex.
Reproduction on newer main74981fa (2026-10-11)
Windows11/Winlibs GCC15.2r7/Release, main74981fa plus only focused D64 color change3034273: windows_exceptions again exits0xc0000409 in the completed833-test run (822pass,5skip,6fail) and in a serial isolated recheck. This stack does not carry our earlier pending min/max or locale overlay. The symptom remains the through-runtime-frames exception/terminate path. It is another reproduction on this toolchain, not a bisect of the originating change, proof about #3415, or a new diagnosis. Existing aperture failures remain on #3291. AI-assisted validation/report: Codex.
Recheck on a11-based MSAA integration (2026-10-11)
On Windows11 Enterprise26200 / WinLibs GCC15.2r7 / Release/BUILD_TESTING=ON, integration f7a2bf691, based on maina11c8f7f:
windows_exceptionsagain fails in the842-test full run and a subsequent serial isolated recheck. Samestd::runtime_error,what(): through runtime frames, libc terminate/SIGABRT, exit0xc0000409. Full build/all122 libraries pass; full run835pass/5skip/2fail. This stack carries kernel/math/D64 and sampled-MSAA proposals; it is not unchanged main. No new originating-change bisect, #3415 validation, or root-cause claim. The earlier exact-Math source control remains attributed to the earlier base. AI-assisted validation/report: Codex.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-11T14:59:18Z.
I updated #3415 to remove its ineffective
VirtualQuerychange and replace thestd::call_oncetest path with recursive guest frames. The new test still checks destructor cleanup at depths 0, 1, 7 and 64 using the unwind tables the current Windows unwinder supports.This corrects the regression introduced by the test's assumption that exceptions can cross the WinLibs
libwinpthread/libstdc++frames. It does not add SEH unwinding; the limitation and lack ofRtlVirtualUnwind/Windows cleanup-handler support are recorded in TechnicalDebt. I linked this issue from #3415 without marking the underlying SEH limitation fixed.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-11T23:27:33Z.
Closing: #3415 changed the test to unwind through guest frames only. Unwinding through runtime DLL frames that carry only SEH data stays unsupported and is recorded in TechnicalDebt.