Skip to content

fix(native): retry Windows minidumps with the copied exception context - #2353

Open
jpnurmi wants to merge 3 commits into
v1from
jpnurmi/fix/native-minidump-xstate
Open

jpnurmi wants to merge 3 commits into
v1from
jpnurmi/fix/native-minidump-xstate

Conversation

@jpnurmi

@jpnurmi jpnurmi commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

The minidump-only cases of test_native_scope_updates_without_snapshot fail on some windows-2022 runners with AssertionError: Wait timeout occurred, because the daemon drops the crash:

MiniDumpWriteDump failed: 2147942699
Minidump mode requires minidump, but minidump failed

0x8007012B is ERROR_PARTIAL_COPY. With ClientPointers=TRUE, dbghelp reads the remote context sized by the enabled XSTATE features. With AMX (Intel Advanced Matrix Extensions) enabled in XSTATE 0x608e7, that is 11.3 KiB, which runs past the 6.6-8.0 KiB of stack above the context of this shallow crash.

Retry with the copied exception record and context, as the WER path already does, and as Crashpad reads only sizeof(CONTEXT) of the exception context. Clear CONTEXT_XSTATE in the copy, which only holds sizeof(CONTEXT). On an AMX runner, all 10 minidump-only crashes then produced a minidump.

This has become a real nuisance in CI lately:

Verification:

The minidump-only cases of `test_native_scope_updates_without_snapshot`
fail on some `windows-2022` runners with `AssertionError: Wait timeout
occurred`, because the daemon drops the crash:

    MiniDumpWriteDump failed: 2147942699
    Minidump mode requires minidump, but minidump failed

`0x8007012B` is `ERROR_PARTIAL_COPY`. With `ClientPointers=TRUE`,
dbghelp reads the remote context sized by the enabled XSTATE features.
With AMX enabled (XSTATE `0x608e7`), that is 11.3 KiB, which runs past
the 6.6-8.0 KiB of stack above the context of this shallow crash.

Retry with the copied exception record and context, as the WER path
already does, and as Crashpad reads only `sizeof(CONTEXT)` of the
exception context. Clear `CONTEXT_XSTATE` in the copy, which only holds
`sizeof(CONTEXT)`. On an AMX runner, all 10 minidump-only crashes then
produced a minidump.

Failures:
- https://github.com/getsentry/sentry-native/actions/runs/43460190688/job/132004723418
- https://github.com/getsentry/sentry-native/actions/runs/44277473923/job/134709168872
- https://github.com/getsentry/sentry-native/actions/runs/44277473923/job/134709168940
- https://github.com/getsentry/sentry-native/actions/runs/44509847830/job/135510909755
- https://github.com/getsentry/sentry-native/actions/runs/45645459970/job/139315482377
- https://github.com/getsentry/sentry-native/actions/runs/45789616342/job/139805024432
- https://github.com/getsentry/sentry-native/actions/runs/45972837352/job/140473685255

Verification:
https://github.com/getsentry/sentry-native/actions/runs/46023305396/job/140596731823
@jpnurmi
jpnurmi force-pushed the jpnurmi/fix/native-minidump-xstate branch from b5cd33e to 2fccaae Compare November 27, 2026 16:50
CONTEXT_XSTATE and CONTEXT_CONTROL are signed long constants, which
fails the ClangCL build with -Wsign-conversion.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant