Skip to content

fix(breakpad): avoid double decref after on_crash - #1990

Merged
JoshuaMoelans merged 1 commit into
masterfrom
joshua/fix/breakpad_decref_after_on_crash
Aug 14, 2026
Merged

JoshuaMoelans merged 1 commit into
masterfrom
joshua/fix/breakpad_decref_after_on_crash

Conversation

@JoshuaMoelans

Copy link
Copy Markdown
Member

Similar to how we do it in inproc, we re-assign to the event itself. The subsequent decref(event) becomes a no-op (since the return value of the on_crash on a discard is supposed to be sentry_value_new_null as per the contract), whereas before, we would have a double decref(event) (once by the user in the on_crash, and once in the !should_handle branch.

#skip-changelog

Comment on lines +163 to +164
event = options->on_crash_func(uctx, event, options->on_crash_data);
should_handle = !sentry_value_is_null(event);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

we still call decref(event) later on, but since this would now happen on a sentry_value_new_null it's a no-op (consistent with how inproc handles this). We could also remove the decrefs from both 🤔

@codecov

codecov Bot commented Aug 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.33%. Comparing base (efe5fff) to head (64749ae).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1990      +/-   ##
==========================================
+ Coverage   74.19%   74.33%   +0.14%     
==========================================
  Files         104      104              
  Lines       25634    25633       -1     
  Branches     4626     4626              
==========================================
+ Hits        19018    19054      +36     
+ Misses       5317     5276      -41     
- Partials     1299     1303       +4     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jpnurmi

jpnurmi commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

How did it come up? Found by coincidence?

@JoshuaMoelans

Copy link
Copy Markdown
Member Author

@jpnurmi yeah kind of, in the review of getsentry/sentry-unreal#1536 Claude found this 👀

@JoshuaMoelans
JoshuaMoelans merged commit 231cb89 into master Aug 14, 2026
102 of 103 checks passed
@JoshuaMoelans
JoshuaMoelans deleted the joshua/fix/breakpad_decref_after_on_crash branch August 14, 2026 09:31
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