Repository navigation
fix: prevent false native crash reports from handled exceptions in Native AOT apps on Linux and macOS - #5989
Conversation
PR risk: highFor commit Main concerns: dependencies customers inherit, reach, host performance. Rules that block low also fired:
This label is a hint for reviewers, not an approval. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5989 +/- ##
==========================================
+ Coverage 78.12% 78.15% +0.02%
==========================================
Files 537 537
Lines 20077 20077
Branches 4041 4041
==========================================
+ Hits 15686 15692 +6
+ Misses 3545 3542 -3
+ Partials 846 843 -3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
4586a19 to
54ae6e7
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort 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 3533d85. Configure here.
3533d85 to
fa2cd39
Compare
fa2cd39 to
3fdc82c
Compare
|
Mutation testing breaks the lines a PR changes on purpose, one mutation at a time, and checks that a test fails each time. A changed line no test runs fails the check, and a mutant that survives the tests only warns. Full report Sentry: tests caught 3 of 5 mutants on the changed lines
|
How
|
jamescrosswell
left a comment
There was a problem hiding this comment.
Tested locally on macOS arm64 (net10.0 and net11.0): the new test fails on the base commit, which reports a false SIGSEGV crash on the next launch, and passes with this change. The existing native-crash test passes in both cases.
3fdc82c to
5bf8b2c
Compare
This is the desktop counterpart of #5127 for Android and #5126 for iOS. In Native AOT apps on Linux and macOS, sentry-native installed its signal handlers on top of the .NET runtime's, so a `SIGSEGV` raised by a managed null dereference reached sentry-native first. It recorded a native crash before chaining to the runtime, which then threw the `NullReferenceException` as usual. The app kept running, but the next launch reported a false crash. Link a constructor object that preloads sentry-native before `main`, so it installs its handlers before the runtime does. The runtime then handles managed faults itself and passes native crashes on to sentry-native. Ref: #4867 Co-authored-by: Claude Opus 5.5 <[email protected]>
Pin the native sources to LF, so Windows hashes them the same as macOS and Linux.
5bf8b2c to
d992e2d
Compare
|
Optional: the title becomes the changelog line, and it describes the mechanism rather than what users see. The Android and iOS counterparts were titled by symptom ("fix: prevent redundant native exceptions on Android/CoreCLR"). |

This is the desktop counterpart of #5127 for Android and #5126 for iOS.
In Native AOT apps on Linux and macOS, sentry-native installed its signal handlers on top of the .NET runtime's, so a
SIGSEGVraised by a managed null dereference reached sentry-native first. The native SDK recorded it as a native crash before chaining to the runtime, which then threw theNullReferenceExceptionas usual. The app kept running, but the next launch reported a false crash.Link a constructor object that preloads sentry-native before
main, so it installs its handlers before the runtime does. The runtime then handles managed faults itself and passes native crashes on to sentry-native.Refs #4867