fix: prevent redundant native exceptions on Android/CoreCLR#5127
Draft
jpnurmi wants to merge 2 commits intofeat/android-signal-handler-strategyfrom
Draft
fix: prevent redundant native exceptions on Android/CoreCLR#5127jpnurmi wants to merge 2 commits intofeat/android-signal-handler-strategyfrom
jpnurmi wants to merge 2 commits intofeat/android-signal-handler-strategyfrom
Conversation
Contributor
Semver Impact of This PR⚪ None (no version bump detected) 📋 Changelog PreviewThis is how your changes will appear in the changelog. Features ✨
Fixes 🐛
🤖 This preview updates automatically when you update the PR. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## feat/android-signal-handler-strategy #5127 +/- ##
========================================================================
- Coverage 73.99% 73.96% -0.03%
========================================================================
Files 499 499
Lines 18067 18067
Branches 3519 3520 +1
========================================================================
- Hits 13368 13364 -4
- Misses 3839 3840 +1
- Partials 860 863 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
57fd7bb to
7b2244a
Compare
7b2244a to
e5df035
Compare
Enable the io.sentry.ndk.preload metadata so that SentryNdkPreloadProvider installs sentry-native's signal handlers before .NET/CoreCLR. This ensures the correct handler chain order (.NET -> sentry-native -> debuggerd) where .NET handles managed exceptions first, and native crashes chain to sentry-native. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
e5df035 to
2a35e7a
Compare
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.
Note
Depends on getsentry/sentry-native#1613
Fixes duplicate native exceptions (#3954) on Android by reordering signal handlers to let .NET/CoreCLR handle managed exceptions first, and then chain real native exceptions to Sentry.
Before:
After:
This approach only works with CoreCLR (
UseMonoRuntime=false, experimental in Android .NET 10.0+) for the time being.With Mono, one will have to opt in for the "chain at start" signal handler strategy until the following fix has been released: