Repository navigation
fix(libc): report instead of repairing contexts that omit AVX state - #34
Merged
Merged
Conversation
The repair could not work. On an affected kernel (tested on Windows 11 26200.5761), the AVX state is already lost when a vectored handler runs: XINUSE shows AVX not in use at the handler, so its XSAVE holds zeros, and the true upper halves cannot be restored from user mode. The vectored handler now only recognises a resumed exception whose compacted XSAVE header omits enabled vector components. It reports the kernel bug once on stderr, with the fix (the Windows update), and counts further contexts (first 20, then every 1000th). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Follow-up to #33. That PR was merged with only its first commit: a vectored-handler repair that writes the omitted AVX state back into an exception context. On an affected kernel this repair can't work, so this PR replaces it.
Background: on Windows 11 24H2/25H2 kernels before 26100.7920 (OS build 26100.7922, KB5077241), and on Windows Server 2025, the kernel can build a user-mode exception's context from a stale XSAVE header on the stack (JDK-8365196). The context then omits the AVX state the thread is using.
Why the repair fails: on a player's Windows 11 26200.5761, the upper halves of ymm0-15 were already zero when the vectored handler ran. XINUSE showed AVX not in use, so the handler's XSAVE held only zeros. The true values can't be restored from user mode.
ReportCrashCheckingXState. WhenReportCrashresumes an exception, it checks whether the context's compacted XSAVE header omits enabled vector components (XCR0 bits 2, 5, 6, 7). It only reads the context.Tested
CrashReport.cppcompiles with-std=c++20 -Wall, no warnings.PAGE_READONLYpage with a complete context is not reported. The same fault, with the header set to what an affected kernel produces (XSTATE_BV 0,XCOMP_BV 0x8000000000000000), is reported with0xe4omitted.ctestsuite was not run (no MSYS2 UCRT64 environment here). No title was run against this branch.Checklist
main🤖 Generated with Claude Code