Conversation
mujacica
commented
Oct 29, 2025
- Sentry native crash backend
- Out-of-process daemon/handler
- MacOS/Android/Windows/Linux support
- Integration with external crash reporter
- IPC/SHM/Signaling multi-platform implementation
- Minidump writers for all platforms
- In-process option (process_crash function)
- Different options for Minidump sizes
- Full sentry-codebase integration
- Sentry logger integration
- Sentry debug-flags integration
|
@sentry review |
1 similar comment
|
@sentry review |
216b3cd to
e4cd98c
Compare
|
@sentry review |
|
@cursor review |
|
@cursor review |
d634773 to
eb77775
Compare
|
@sentry review |
d46d50a to
d38b5e1
Compare
d33258f to
71ea60d
Compare
|
79d2b05 to
a6af7d6
Compare
…ro stack_start_out on alloc failure - current_offset was uint32_t, making the > UINT32_MAX check always false. Widening to uint64_t lets the guard actually detect overflow. - write_thread_stack now zeros *stack_start_out on malloc failure, matching the macOS counterpart. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… structs The previous commit widened current_offset to uint64_t in the base struct but not in the Linux/macOS platform structs, causing a layout mismatch that corrupted the crash_ctx pointer on every write_data call. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…permissions - aarch64 Linux: use struct field access (uctx->uc_mcontext.regs[i], .sp, .pc) instead of raw pointer indexing that skipped fault_address, causing every register value to be shifted by one - Windows: request PROCESS_DUP_HANDLE when opening crashed process in FULL mode, needed for MiniDumpWithHandleData Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…rning on aarch64 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- write_data: seek back on partial write to keep fd position in sync with current_offset - write_module_list_stream: bail early if initial module list write fails (rva==0) to prevent patching into header area - thread_context.size: only set non-zero when write_thread_context succeeds, preventing invalid location descriptors pointing at offset 0 (Linux and macOS, 5 locations) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…g write sync - Update thread_context.size after ptrace re-write in Linux minidump writer so it stays consistent with the RVA - Validate bytes_read matches requested size in macOS read_task_memory to detect partial reads - Seek back on partial padding write in write_data to keep fd position in sync with current_offset Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- macOS SMART mode now only captures the crash-address region instead of all readable+writable regions, matching Linux behavior and the ~5-10MB target documented in the API - Cap per-region size to 4MB (was 64MB) to match Linux - Add UINT32_MAX overflow check in write_data to prevent silent RVA truncation when minidumps exceed 4GB in FULL mode Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix minidump OS platform IDs to match Breakpad MDOSPlatform standard: Linux 0x8201, macOS 0x8101, iOS 0x8102, Android 0x8203. Previous values (0x8000-0x8003) caused server-side misidentification. - Fix write_thread_stack to find non-main thread stacks by falling back to anonymous rw-p mappings when no named [stack] mapping is found. On Linux, only the main thread stack is labeled [stack] in /proc/pid/maps; all other thread stacks are anonymous. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…CE order - Guard malloc(0) when module_count is zero to avoid implementation- defined NULL return being treated as allocation failure - Add MiscInfoStream (with process_id) to the full macOS minidump path, matching the fallback path and ensuring consistent server-side processing - Move _XOPEN_SOURCE definition before all system header includes so ucontext_t is properly exposed on strict POSIX systems Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Replace mach_thread_self() with pthread_mach_thread_np(pthread_self()) in crash signal handler to avoid leaking a Mach port reference (mach_port_deallocate is not async-signal-safe) - Fix x86_64 FPU instruction/data pointer truncation: split 64-bit fpregs.rip/rdp across error_offset+error_selector and data_offset+data_selector per FXSAVE format - Copy fpregs.fop to error_opcode on Linux (was missing, already done on macOS) - Copy __fpu_cs/__fpu_ds to error_selector/data_selector on macOS - Always write 5 streams on Linux (matching macOS), using an empty memory list for STACK_ONLY instead of omitting it Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Condition stack_size_out and mem->memory.size on write_data returning a non-zero RVA. Previously, rva=0 with size>0 would cause minidump parsers to read from offset 0 (the header), producing corrupt results. Fixed in both Linux and macOS writers for stack and memory list streams. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Skip segments with initprot=0 and maxprot=0 (__PAGEZERO) when calculating module size on macOS. __PAGEZERO has vmsize=4GB on 64-bit, which inflated size_of_image and caused overlapping module ranges in minidumps. - Guard thread stack descriptor in macOS fallback path against write_data failure, matching the pattern used elsewhere. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
aa9763c to
efa6859
Compare
The idle threshold was a workaround for the broken snapshot-and-compare approach. The 5s cond_wait_timeout is the batching window — when it fires and there are items, flush them. This matches the original master behavior and removes the last_enqueue_ms field and its atomic bookkeeping. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
- CHANGELOG: note the native backend feature as experimental and under active development - CMakeLists.txt: emit CMake WARNING when selecting the native backend - sentry_backend_native.c: log SENTRY_WARN at startup - README: add native backend to the SENTRY_BACKEND options list with (Experimental) tag Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Only accept native-endian Mach-O magic. Byte-swapped binaries (MH_CIGAM*) cannot be loaded on the current platform, so accepting them without swapping all header fields would cause corrupt reads. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: J-P Nurmi <jpnurmi@gmail.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 9 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.