You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unhandled crashes are not been reported in release mode on iOS apps #4012
Unhandled exceptions in debug profile are caught and shown in the sentry dashboard for the iOS .NET9 MAUI (9.0.40) app (AOT compiled, doesn't work either is not AOT compiled).
In release mode, unhandled exceptions is captured.
Actual Result
Unhandled exceptions in debug profile are caught and shown in the sentry dashboard for the .NET9 MAUI (9.0.40) app.
In release mode, nothing is captured on unhandled exceptions making it very difficult to diagnose crashes since porting to .NET9.
Is there a way to manually add debug symbols like you could with AppCenter, in this case the builds are not generated via a pipeline.
I can't share the URL here but do you have a mailbox I can send the URL's to ?
There is data in stats but as mentioned, it's only debug crashes with a debugger attached
thanks for the link for the symbols but a bit of a clunky process if your a VS2022 Windows users and you have to look for the build manually on the mac host
thanks for the link for the symbols but a bit of a clunky process if your a VS2022 Windows users and you have to look for the build manually on the mac host
If you're doing it via MS Build, the transitive build file should run all the necessary CLI commands for you from wherever the build is running... and you should get logs of all that happening in your Debug window as the build occurs. That experience should be pretty similar to what it would feel like to do this directly on a Mac using Jetbrains Rider or the command line.
If you want to run the CLI commands yourself manually then yes, using a remote Mac will make it a bit more painful. But then everything is a bit more painful when you try to build iOS apps from Windows. That's basically a consequence of the requirement to use Xcode to build iOS apps (so not specific to Sentry).
thanks for the link for the symbols but a bit of a clunky process if your a VS2022 Windows users and you have to look for the build manually on the mac host
If you're doing it via MS Build, the transitive build file should run all the necessary CLI commands for you from wherever the build is running... and you should get logs of all that happening in your Debug window as the build occurs. That experience should be pretty similar to what it would feel like to do this directly on a Mac using Jetbrains Rider or the command line.
If you want to run the CLI commands yourself manually then yes, using a remote Mac will make it a bit more painful. But then everything is a bit more painful when you try to build iOS apps from Windows. That's basically a consequence of the requirement to use Xcode to build iOS apps (so not specific to Sentry).
That's not particularly helpful. It doesn't explain why unhandled crashes (race condition I suspect as it was ok in .NET8 release mode) aren't caught but they are in debug build config, we need to have confidence it does that basics before we can release the apps.
The UnhandledException hook isn't fired when using CoreCLR (on macOS or when using NativeAOT)... which is why we're using Runtime.MarshalManagedException.
Apparently @mackayn has found a scenario where Runtime.MarshalManagedException isn't firing either though. I haven't had a chance to dig into this yet or reproduce/confirm the issue.
@mackayn have you made any progress understanding where the crashes are coming from and how we might reproduce this? Simple scenarios like the unhandled crashes caused by our sample app are captured by Sentry, so we need to work out what's happening in your scenario that's not happening in the context of that sample app to be able to reproduce and resolve the issue.
The UnhandledException hook isn't fired when using CoreCLR (on macOS or when using NativeAOT)... which is why we're using Runtime.MarshalManagedException.
Apparently @mackayn has found a scenario where Runtime.MarshalManagedException isn't firing either though. I haven't had a chance to dig into this yet or reproduce/confirm the issue.
@mackayn have you made any progress understanding where the crashes are coming from and how we might reproduce this? Simple scenarios like the unhandled crashes caused by our sample app are captured by Sentry, so we need to work out what's happening in your scenario that's not happening in the context of that sample app to be able to reproduce and resolve the issue.
No, as mentioned, the crash was low level. Identical C# code that worked in .NET8 was crashing the app in .NET9, compiling with the interpreter enabled in iOS solves the issue, something was been stripped out. It's worth mentioning that the crash occurred whether compiling with or without AOT compilation. We're only trimming the Sdk (SdkOnly).
Having looked at macios/#15252, If this is a .NET issue and not a Sentry issue, I am happy for this to be closed, oddly UnhandledExceptionHandler helped me get a clue, maybe on that test I'd compiled with AOT disabled but from reading the macOS issue, maybe it's not a great idea to hook it up as we're using AOT compilation in iOS now as it improves app startup performance.
Even with this being a dotnet issue we could keep this ticket open and try to find a work around. such as using FirstChanceException and letting some types of errors through, for example.
Even with this being a dotnet issue we could keep this ticket open and try to find a work around. such as using FirstChanceException and letting some types of errors through, for example.
Without being able to reproduce the original problem, I can't see too much more we can do with this. I can't see any meaningful way to use the FirstChanceException.
Closing for now then. @mackayn if you're able to provide a reproducible example then we can dig into it further.
Activity
bruno-garcia commentedon Feb 28, 2025
Do you have any logs of the sdk you can share? you can turn it on with Debug=true and get them from the mac console streaming ur phones logs.
also if you have a link to your Sentry project I can see if there's data ben dropped. You can see that too under Stats in the left nav bar
sentry can upload during msbuild build (https://docs.sentry.io/platforms/dotnet/configuration/msbuild/ ) but if you want to upload outside of msbuild you can with our CLI (which is what we use under the hood from the sdk too): https://docs.sentry.io/platforms/apple/dsym/
mackayn commentedon Feb 28, 2025
I can't share the URL here but do you have a mailbox I can send the URL's to ?
There is data in stats but as mentioned, it's only debug crashes with a debugger attached
thanks for the link for the symbols but a bit of a clunky process if your a VS2022 Windows users and you have to look for the build manually on the mac host
jamescrosswell commentedon Mar 3, 2025
If you're doing it via MS Build, the transitive build file should run all the necessary CLI commands for you from wherever the build is running... and you should get logs of all that happening in your Debug window as the build occurs. That experience should be pretty similar to what it would feel like to do this directly on a Mac using Jetbrains Rider or the command line.
If you want to run the CLI commands yourself manually then yes, using a remote Mac will make it a bit more painful. But then everything is a bit more painful when you try to build iOS apps from Windows. That's basically a consequence of the requirement to use Xcode to build iOS apps (so not specific to Sentry).
mackayn commentedon Mar 3, 2025
That's not particularly helpful. It doesn't explain why unhandled crashes (race condition I suspect as it was ok in .NET8 release mode) aren't caught but they are in debug build config, we need to have confidence it does that basics before we can release the apps.
18 remaining items
jamescrosswell commentedon Mar 5, 2025
The trouble is that UnhandledExceptionHandler does not always fire on MAUI.
See here:
The UnhandledException hook isn't fired when using CoreCLR (on macOS or when using NativeAOT)... which is why we're using
Runtime.MarshalManagedException.Apparently @mackayn has found a scenario where
Runtime.MarshalManagedExceptionisn't firing either though. I haven't had a chance to dig into this yet or reproduce/confirm the issue.@mackayn have you made any progress understanding where the crashes are coming from and how we might reproduce this? Simple scenarios like the unhandled crashes caused by our sample app are captured by Sentry, so we need to work out what's happening in your scenario that's not happening in the context of that sample app to be able to reproduce and resolve the issue.
mackayn commentedon Mar 6, 2025
No, as mentioned, the crash was low level. Identical C# code that worked in .NET8 was crashing the app in .NET9, compiling with the interpreter enabled in iOS solves the issue, something was been stripped out. It's worth mentioning that the crash occurred whether compiling with or without AOT compilation. We're only trimming the Sdk (SdkOnly).
Having looked at macios/#15252, If this is a .NET issue and not a Sentry issue, I am happy for this to be closed, oddly UnhandledExceptionHandler helped me get a clue, maybe on that test I'd compiled with AOT disabled but from reading the macOS issue, maybe it's not a great idea to hook it up as we're using AOT compilation in iOS now as it improves app startup performance.
bruno-garcia commentedon Mar 7, 2025
Even with this being a dotnet issue we could keep this ticket open and try to find a work around. such as using FirstChanceException and letting some types of errors through, for example.
jamescrosswell commentedon Apr 1, 2025
Without being able to reproduce the original problem, I can't see too much more we can do with this. I can't see any meaningful way to use the
FirstChanceException.Closing for now then. @mackayn if you're able to provide a reproducible example then we can dig into it further.
mackayn commentedon Apr 1, 2025
@jamescrosswell Fair enough but probably have to stop using it.