Skip to content

Commit a3ecf71

Browse files
jpnurmiclaude
andcommitted
fix(native): pad minidump_context_arm_t to match on-disk minidump spec
minidump_context_arm_t was 72 bytes (integers + cpsr), but the on-disk minidump spec for ARM contexts — as implemented by breakpad (MDRawContextARM) and rust-minidump (CONTEXT_ARM, the reader Sentry's ingest uses to deserialize these streams) — is 368 bytes, with a trailing float-save area (fpscr u64, 32x u64 VFP regs, 8x u32 extra). rust-minidump's struct is explicitly called out as a "Breakpad extension": https://github.com/rust-minidump/rust-minidump/blob/d4fefc765aad35b3bef569d53c1680eadab5a268/minidump-common/src/format.rs#L1034-L1055 Since get_context_size() returns sizeof(minidump_context_arm_t), the stream size recorded in the minidump was too small and downstream parsers couldn't deserialize the thread context. Add the missing float-save trailing fields. They're left zero- initialized (we don't capture VFP state yet — same punt the i386 branch makes for FPU) but the layout now matches what readers expect. The other arches in this file (i386, aarch64) already carry their full structs this way. Note: crashpad's in-memory MinidumpContextARM is 364 bytes (u32 fpscr), a 4-byte divergence from breakpad despite crashpad's comment saying it's "included for compatibility with breakpad." That's a crashpad-internal quirk; on-disk minidumps follow the breakpad layout that rust-minidump reads. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent aeb2d94 commit a3ecf71

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

src/backends/native/minidump/sentry_minidump_format.h

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,10 +304,17 @@ PACKED_STRUCT_BEGIN
304304
typedef struct {
305305
uint32_t context_flags;
306306
uint32_t r[13]; // R0-R12
307-
uint32_t sp;
308-
uint32_t lr;
309-
uint32_t pc;
307+
uint32_t sp; // R13
308+
uint32_t lr; // R14
309+
uint32_t pc; // R15
310310
uint32_t cpsr;
311+
// VFP/NEON state (matches breakpad's MDRawContextARM / Microsoft's
312+
// CONTEXT_ARM floating-point area). We don't populate these today
313+
// but the layout needs to match what downstream minidump parsers
314+
// (crashpad, rust-minidump, breakpad) expect when reading the stream.
315+
uint64_t fpscr;
316+
uint64_t fpregs[32]; // D0-D31
317+
uint32_t fpextra[8];
311318
} PACKED_ATTR minidump_context_arm_t;
312319
PACKED_STRUCT_END
313320
#endif

0 commit comments

Comments
 (0)