Skip to content

minidump serialization#176

Merged
sha0coder merged 5 commits intosha0coder:mainfrom
brandonros:minidump
Apr 14, 2026
Merged

minidump serialization#176
sha0coder merged 5 commits intosha0coder:mainfrom
brandonros:minidump

Conversation

@brandonros
Copy link
Copy Markdown
Contributor

part of #114

brandonros and others added 2 commits April 12, 2026 17:32
- make SerializableThreadContext and SerializableEmu arch-aware
- route minidump import through current-thread helpers
- add a serialization roadmap for the remaining native/minidump work

Co-Authored-By: OpenAI Codex <codex@openai.com>
brandonros and others added 2 commits April 13, 2026 09:32
Complete the serialization roadmap for AArch64 architecture parity:

- Fix native serialization stack overflow by running tests with large
  thread stacks (same pattern as the existing should_serialize test)
- Replace placeholder test_serialization_module_exists with real
  x86_64 native roundtrip test
- Unignore test_aarch64_native_serialization_fixture_roundtrip

- Implement ARM64 minidump import: parse MinidumpRawContext::Arm64 and
  OldArm64, map register state into RegsAarch64, build architecture-
  aware SerializableEmu via new default_for_arch() and set_regs_aarch64()
- Fix is_pe64 to recognize ARM64 PE machine type (0xAA64)
- Fix is_64bits to include Arm64 CPU type

- Implement ARM64 minidump export: emit CONTEXT_ARM64 blob (912 bytes)
  with NZCV flags, x0-x30, sp, pc, NEON V0-V31, fpcr/fpsr
- Refactor build_thread_context to use ThreadContextInput enum
- Refactor stack_location_for_thread to accept sp directly
- Remove architecture guards blocking AArch64 in writer

- Add test_aarch64_minidump_roundtrip with register, NZCV, and SIMD
  state verification
- Unignore test_aarch64_minidump_fixture_roundtrip
- All 231 tests pass with 0 failures

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Emu::new(arch) now initializes ArchState, ThreadContext, and Maps.is_64bits
correctly at construction time, eliminating the window where cfg.arch
disagrees with the actual thread state. Factory functions (emu32/emu64/
emu_aarch64) simplified to one-liners.

This exposed a latent bug: the 64-bit allocator places maps above 4 GB
but the exception handler context pointer (eh_ctx) was stored as u32,
causing a panic. Widened eh_ctx to u64 across ThreadContext,
serialization structs, and exception handler enter/exit paths.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@brandonros brandonros marked this pull request as ready for review April 13, 2026 13:54
Also replace all hardcoded relative paths in tests with
helpers::win32_maps_folder(), helpers::win64_maps_folder(), and
helpers::test_data_path() so tests pass regardless of working directory
(fixes CI failure on Windows runner).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@sha0coder sha0coder merged commit fe42820 into sha0coder:main Apr 14, 2026
3 checks passed
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.

2 participants