fix: prevent redundant native exceptions on iOS#5126
Conversation
Semver Impact of This PR⚪ None (no version bump detected) 📋 Changelog PreviewThis is how your changes will appear in the changelog. Fixes 🐛
🤖 This preview updates automatically when you update the PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5126 +/- ##
==========================================
- Coverage 74.12% 73.99% -0.14%
==========================================
Files 499 499
Lines 18067 18067
Branches 3520 3520
==========================================
- Hits 13392 13368 -24
- Misses 3813 3839 +26
+ Partials 862 860 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@jamescrosswell @Flash0ver Is turning sentry-cocoa into a submodule and building it on the fly a deal-breaker? Maybe we could cache sentry-cocoa builds in the CI similarly to sentry-native? I hate that it slows down local builds, though... 😭 |
- Build sentry-cocoa with SENTRY_CRASH_MANAGED_RUNTIME to preload signal handlers and exclude EXC_BAD_ACCESS/EXC_ARITHMETIC from Mach monitoring - Call PrivateSentrySDKOnly.IgnoreNextSignal(SIGABRT) from MarshalManagedException to prevent duplicate native crash events - Update iOS integration tests to expect no duplicate events (#3954) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
c4f6ee3 to
0fdf17d
Compare
|
My biggest concern was the impact of replacing the officially released and signed bundle with an unsigned self-built bundle. TL;DR: DetailsSurprising finding about Sentry's release signingThe $ codesign -dv --verbose=4 Sentry-9.7.0.xcframework
Authority=Apple Distribution: GetSentry LLC (97JCY7859U)
Authority=Apple Worldwide Developer Relations Certification Authority
Authority=Apple Root CA
TeamIdentifier=97JCY7859U
Sealed Resources version=2 rules=10 files=789
$ codesign -dv --verbose=4 Sentry-9.7.0.xcframework/ios-arm64/Sentry.framework
.../ios-arm64/Sentry.framework: code object is not signed at allThe dotnet-ios re-signs with
|
Note
Depends on sentry-cocoa 9.10.0 (getsentry/sentry-cocoa#6193)
Fixes duplicate native exceptions (#3954) on iOS by reordering signal handlers to let .NET/Mono handle managed exceptions first, and then chain real native exceptions to Sentry.
Before:
After:
Good news: the re-ordered signal handlers are working as expected.
Bad news: The early signal handler installation in getsentry/sentry-cocoa#6193 is guarded behind a
SENTRY_CRASH_MANAGED_RUNTIMEcompile-time flag to avoid affecting normal Cocoa SDK users. iOS integration tests were happily passing while developing with a localmodules/sentry-cocoaclone, but I do realize now that this cannot work with the pre-builtSentry.xcframeworkrelease bundles built withoutSENTRY_CRASH_MANAGED_RUNTIME... 🤦