fix: prevent redundant native exceptions on iOS#5126
fix: prevent redundant native exceptions on iOS#5126jpnurmi wants to merge 2 commits intojpnurmi/build/cocoa-submodulefrom
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 @@
## jpnurmi/build/cocoa-submodule #5126 +/- ##
=================================================================
+ Coverage 73.98% 74.00% +0.02%
=================================================================
Files 499 499
Lines 18067 18067
Branches 3520 3520
=================================================================
+ Hits 13366 13370 +4
+ Misses 3839 3838 -1
+ Partials 862 859 -3 ☔ 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... 😭 |
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
|
Allows building sentry-cocoa with `SENTRY_CRASH_MANAGED_RUNTIME` for eliminating duplicate native exceptions on iOS. See also: - getsentry/sentry-cocoa#6193 - #5126
- 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>
42ca1ff to
1b3eee3
Compare
Note
Depends on sentry-cocoa 9.10.0 + modules/sentry-cocoa submodule:
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... 🤦