Skip to content

[WIP] ref!: sentry_value-based attachments - #1974

Open
jpnurmi wants to merge 7 commits into
masterfrom
jpnurmi/ref/attachments
Open

[WIP] ref!: sentry_value-based attachments#1974
jpnurmi wants to merge 7 commits into
masterfrom
jpnurmi/ref/attachments

Conversation

@jpnurmi

@jpnurmi jpnurmi commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Warning

WIP    🚧🔨⏳⛔

Caution

BREAKING CHANGE

Attachment setters now accept sentry_value_t. Attach helpers return sentry_uuid_t instead of sentry_attachment_t *, and removal takes an attachment UUID.

Scope data is moving to fine-grained read/write locking to allow concurrent readers. A read-locked getter cannot safely return a borrowed sentry_attachment_t pointer because a writer may remove and free the attachment as soon as the read lock is released.

Represent attachments and attachment collections as refcounted sentry_value_t objects. A getter can retain the value under the read lock and return an owned reference that remains valid after unlocking.

Configure attachments before insertion and freeze them once added. Use UUIDs for removal, and retain byte values while envelopes borrow their payload to avoid copying attachment data.

Resolves: #1945

@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown
Fails
🚫 Please consider adding a changelog entry for the next release.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

Example:

## Unreleased

### Features

- sentry_value-based attachments ([#1974](https://github.com/getsentry/sentry-native/pull/1974))

If none of the above apply, you can opt out of this check by adding #skip-changelog to the PR description or adding a skip-changelog label.

Generated by 🚫 dangerJS against 77576ea

@codecov

codecov Bot commented Aug 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 71.84751% with 192 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.27%. Comparing base (e5d9bca) to head (77576ea).

Additional details and impacted files
@@                        Coverage Diff                        @@
##           jpnurmi/fix/unwinder-arm32-ip    #1974      +/-   ##
=================================================================
+ Coverage                          74.25%   74.27%   +0.01%     
=================================================================
  Files                                104      104              
  Lines                              25365    25616     +251     
  Branches                            4535     4566      +31     
=================================================================
+ Hits                               18835    19026     +191     
- Misses                              5232     5302      +70     
+ Partials                            1298     1288      -10     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jpnurmi
jpnurmi force-pushed the jpnurmi/ref/attachments branch from 4ecd0c8 to 7cfebae Compare August 11, 2026 20:01
On ARM32, unw_step first asks libunwind whether the current frame is a
signal frame. The vendored implementation answers that by reading an
instruction directly from the cursor's initial IP. Its local address-space
validation is enabled only after this probe, so an unmapped IP faults inside
the crash handler instead of returning an unwind error.

This surfaced when unrelated stack-layout changes made the handler fallback
produce 0x10c as its initial IP. No attachment code ran on that path; the
changed layout only exposed the unwinder's unchecked read. The resulting
SIGSEGV recursively entered the crash handler and prevented the original
abort from being captured.

Check /proc/self/maps before calling unw_step. Keep the initial frame, as the
existing invalid-stack-pointer path does, but stop the walk before libunwind
can dereference an unmapped address. Cover the failure with an ARM32 context
whose initial IP is intentionally unmapped.
@jpnurmi
jpnurmi changed the base branch from master to jpnurmi/fix/unwinder-arm32-ip August 12, 2026 06:31
@jpnurmi
jpnurmi force-pushed the jpnurmi/ref/attachments branch from 7cfebae to ed216c7 Compare August 12, 2026 06:33
Comment thread src/sentry_core.c
Comment thread src/sentry_core.c Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 2adc394. Configure here.

Comment thread src/sentry_core.c
Comment thread src/backends/sentry_backend_native.c Outdated
Base automatically changed from jpnurmi/fix/unwinder-arm32-ip to master August 13, 2026 12:47
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.

ref(attachments): rework to be sentry_value_t-based

1 participant