Repository navigation
fix(breakpad): avoid double decref after on_crash - #1990
Merged
Merged
Conversation
JoshuaMoelans
commented
Aug 13, 2026
Comment on lines
+163
to
+164
| event = options->on_crash_func(uctx, event, options->on_crash_data); | ||
| should_handle = !sentry_value_is_null(event); |
Member
Author
There was a problem hiding this comment.
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 Report❌ Patch coverage is 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:
|
jpnurmi
approved these changes
Aug 13, 2026
Collaborator
|
How did it come up? Found by coincidence? |
Member
Author
|
@jpnurmi yeah kind of, in the review of getsentry/sentry-unreal#1536 Claude found this 👀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 theon_crashon a discard is supposed to besentry_value_new_nullas per the contract), whereas before, we would have a doubledecref(event)(once by the user in the on_crash, and once in the !should_handle branch.#skip-changelog