Conversation
Use a shared MessagePack stream for attachment manifests. The native
backend uses the manifest for attachments generally, while both
out-of-process crash handlers can also use it for crash-time hint
attachments that cannot cross backend IPC. This lets Crashpad consume
those attachments without adding JSON support.
Stream attachment objects directly to avoid format-specific conversion
and buffer the complete manifest for a single file write. Median release
benchmarks measured write/read improvements over legacy JSON of 17%/6%
for one attachment, 74%/17% for 10, and 86%/24% for 100:
1 attachment 10 attachments 100 attachments
MessagePack write 2.3 us 2.4 us 11.8 us
JSON write 2.7 us 8.9 us 82.6 us
MessagePack read 1.3 us 5.6 us 54.1 us
JSON read 1.4 us 6.8 us 71.1 us
Keep legacy JSON compatibility private to the native daemon so it can
still consume manifests written by older SDK versions.
Accept hints in `sentry_scope_capture_event` and pass them to `before_send`. Keep `sentry_capture_event` unchanged. Merge hint and scope attachments before `before_send` and `before_send_feedback`, then use the resulting hint attachments in the envelope. Add `sentry_hint_remove_attachment` and `sentry_hint_clear_attachments` to filter attachments without modifying scopes. BREAKING CHANGE: `before_send` callbacks now take `sentry_hint_t *` instead of `void *` for the hint parameter. `sentry_scope_capture_event` now requires a hint argument; pass `NULL` when no hint is needed. Scope attachment changes inside either callback no longer affect the current event; modify the hint instead. Close: #2098
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## jpnurmi/feat/crash-hints #2119 +/- ##
============================================================
- Coverage 75.32% 75.16% -0.17%
============================================================
Files 104 104
Lines 28069 28294 +225
Branches 5126 5152 +26
============================================================
+ Hits 21143 21267 +124
- Misses 5593 5692 +99
- Partials 1333 1335 +2 🚀 New features to boost your workflow:
|
6418ff1 to
72281f2
Compare
on_crash callbackon_crash callback
72281f2 to
f9cc9af
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit f9cc9af. Configure here.
| crash_event = options->on_crash_func( | ||
| &uctx, crash_event, &hint, options->on_crash_data); | ||
| crash_event = sentry__invoke_on_crash( | ||
| options, &uctx, crash_event, &hint, false); |
There was a problem hiding this comment.
Crashpad lock held during on_crash
Medium Severity
lock_scope_from_handler now runs before on_crash and never releases scope_flush. A fault inside the callback re-enters the handler while that lock is still held, so Windows spins forever on scope_flush and Linux hits _exit before the scoped event is written.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit f9cc9af. Configure here.
on_crash callbackon_crash callback


Fixes: #2102