crash_diag: log silent Windows deaths (0xC000041D) to iris-crash.log - #96
Merged
Conversation
The native CLI dies on some Windows machines during startup with exit code 0xC000041D (STATUS_FATAL_USER_CALLBACK_EXCEPTION) and no message: the fault happens on the stack of a Win32 callback (winit's wndproc), and 64-bit Windows re-raises any exception that escapes a kernel callback as that fixed status, discarding the original cause. The release profile is panic = "abort", so a Rust panic there also prints nothing useful. This is the shape of issue #94. src/crash_diag.rs, installed first thing in main(): * panic hook - runs even under panic=abort, before the abort; writes message + thread + location + backtrace. * Windows vectored exception handler - runs first-chance, before the callback dispatcher swallows the exception; logs the real code, faulting address and a module+offset stack for access violations, illegal/privileged instructions, stack overflow, heap corruption and the fatal-callback status itself. * Windows SetUnhandledExceptionFilter as a backstop. Everything is appended to iris-crash.log and echoed to stderr. Dormant until something crashes - no steady-state cost (verified: no polling thread, no allocation, handlers only entered on an actual OS exception, never for Result::Err / None / release overflow). Self-test: IRIS_CRASH_SELFTEST=panic|thread|segv. Escape hatch if the VEH ever gets noisy: IRIS_CRASH_DIAG=off (panic hook stays). rules/gui/windows-silent-exit-0xc000041d.md records the investigation: what 0xC000041D means, how to symbolize the report, and which re-entrancy theories were ruled out (vendored winit 0.30.13 buffers the re-entrant request_inner_size path; not reproducible on a desktop; not fixed upstream through winit 0.31-beta). Co-Authored-By: Claude Sonnet 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.
The native CLI dies on some Windows machines during startup with exit code 0xC000041D (STATUS_FATAL_USER_CALLBACK_EXCEPTION) and no message: the fault happens on the stack of a Win32 callback (winit's wndproc), and 64-bit Windows re-raises any exception that escapes a kernel callback as that fixed status, discarding the original cause. The release profile is panic = "abort", so a Rust panic there also prints nothing useful. This is the shape of issue #94.
src/crash_diag.rs, installed first thing in main():
Everything is appended to iris-crash.log and echoed to stderr. Dormant until something crashes - no steady-state cost (verified: no polling thread, no allocation, handlers only entered on an actual OS exception, never for Result::Err / None / release overflow).
Self-test: IRIS_CRASH_SELFTEST=panic|thread|segv. Escape hatch if the
VEH ever gets noisy: IRIS_CRASH_DIAG=off (panic hook stays).
rules/gui/windows-silent-exit-0xc000041d.md records the investigation: what 0xC000041D means, how to symbolize the report, and which re-entrancy theories were ruled out (vendored winit 0.30.13 buffers the re-entrant request_inner_size path; not reproducible on a desktop; not fixed upstream through winit 0.31-beta).