-
-
Notifications
You must be signed in to change notification settings - Fork 372
fix: AOT interop with managed .NET runtimes #6193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #6193 +/- ##
=============================================
- Coverage 85.169% 85.070% -0.100%
=============================================
Files 452 452
Lines 27659 27696 +37
Branches 12117 12128 +11
=============================================
+ Hits 23557 23561 +4
- Misses 4054 4091 +37
+ Partials 48 44 -4
... and 6 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
This reverts "Use pre-built version of sentry-cocoa SDK (#3727)" commit d179ec9 and restores the modules/sentry-cocoa Git module checked out at: getsentry/sentry-cocoa#6193
2f90356 to
ed98b04
Compare
Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 4a7a005 | 1229.15 ms | 1243.35 ms | 14.20 ms |
| ae7be93 | 1236.24 ms | 1258.18 ms | 21.94 ms |
| b9ceffb | 1222.57 ms | 1247.96 ms | 25.39 ms |
| 884b224 | 1221.11 ms | 1255.88 ms | 34.77 ms |
| 2a9a505 | 1221.49 ms | 1238.49 ms | 17.00 ms |
| 00d9740 | 1223.53 ms | 1249.75 ms | 26.22 ms |
| e8f9a1d | 1229.02 ms | 1264.17 ms | 35.15 ms |
| 6502818 | 1229.08 ms | 1245.46 ms | 16.37 ms |
| 5712478 | 1220.10 ms | 1239.69 ms | 19.59 ms |
| 8da82b4 | 1220.08 ms | 1248.24 ms | 28.16 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 4a7a005 | 23.75 KiB | 979.96 KiB | 956.22 KiB |
| ae7be93 | 23.75 KiB | 879.24 KiB | 855.49 KiB |
| b9ceffb | 23.75 KiB | 969.07 KiB | 945.32 KiB |
| 884b224 | 23.75 KiB | 879.55 KiB | 855.80 KiB |
| 2a9a505 | 23.75 KiB | 874.46 KiB | 850.71 KiB |
| 00d9740 | 23.75 KiB | 938.32 KiB | 914.57 KiB |
| e8f9a1d | 23.75 KiB | 969.78 KiB | 946.04 KiB |
| 6502818 | 23.75 KiB | 959.45 KiB | 935.70 KiB |
| 5712478 | 23.75 KiB | 969.28 KiB | 945.54 KiB |
| 8da82b4 | 23.75 KiB | 913.63 KiB | 889.88 KiB |
Previous results on branch: jpnurmi/mono-interop
Startup times
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| f651762 | 1232.57 ms | 1259.68 ms | 27.11 ms |
| d171c8f | 1226.86 ms | 1256.95 ms | 30.09 ms |
| 1666de5 | 1208.65 ms | 1245.50 ms | 36.85 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| f651762 | 23.75 KiB | 975.29 KiB | 951.55 KiB |
| d171c8f | 23.75 KiB | 1.02 MiB | 1016.31 KiB |
| 1666de5 | 23.75 KiB | 1.01 MiB | 1016.19 KiB |
Screen.Recording.2025-09-18.at.11.54.52.mov |
ed98b04 to
8559ea9
Compare
db30de0 to
dd33f14
Compare
dd33f14 to
e51c82e
Compare
📜 Description
Prevent the Cocoa SDK from capturing managed .NET exceptions.
First of all, we need to avoid overriding Mono's Mach exception port for
EXC_BAD_ACCESSandEXC_ARITHMETICto allow handling the respective Unix signals. Secondly, Sentry's signal handler has to first invoke Mono's signal handler to give it a chance to convert it into a managed exception and redirect execution into the managed runtime’s exception handling machinery, so that managed code can catch and process the exception as if it were a normal .NET exception. Finally, Sentry's crash capturing kicks in only if we do not detect instruction or stack pointer modifications in the context.💡 Motivation and Context
Fixes a long-standing issue with redundant crash events with Sentry.NET on iOS:
See also similar Sentry Native changes for Android:
💚 How did you test it?
Sentry.Samples.Mauiin Sentry.NET:📝 Checklist
You have to check all boxes before merging:
sendDefaultPIIis enabled.