-
-
Notifications
You must be signed in to change notification settings - Fork 210
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
NETWORK_CAPABILITIES_CHANGED and BATTERY_CHANGED events on Android (with Maui) causing SIGSEGV Segfault #3828
Comments
Thanks for reaching out! |
@bitsandfoxes I'm in the UK so I'm not at my desk right now, but tomorrow I'll try and attach some screenshots of the AOT settings to illustrate what I mean a bit better. |
Just a thought, not sure it'll help but does this happen on the latest preview release of the SDK? version 5 |
Hi @drewrobey, if you're using .NET 9 then you'll want/need to use Sentry version 5.x. Version 4.x wasn't built or tested with .NET 9. Version 5.0.0 isn't yet available. We're hoping to have an early beta available in the couple of weeks. One of the main things that we have to do before making that release is enable the new AOT analyzers for MAUI apps and work through any/all warnings that those produce... so working through issues like this, basically. It'd be great to get some help testing that from people who are already looking to move to .NET 9. |
@jamescrosswell I've only upgraded to .net 9 in this last week, and before that the same crashes were occurring on .net 8 |
This helps narrow down. Thanks |
The email bot is saying it'll close the ticket if I don't respond, so here's a response to make sure that doesn't happen... |
are you sure it was on this ticket? we won't let it close, don't worry. |
@bruno-garcia Yep, it was this ticket: it's the only Sentry ticket I've opened. |
@bruno-garcia Just received another one of the automated emails from sentry.io, the content says:
Would it auto-close the ticket if there's no new info? |
it will not. It would take a long time and we would see this message on the ticket. The bot writes on GitHub, that email doesn't come from Sentry it's just a github notification via email. Unless this is an old email, or about another issue, I'm not sure why you would receive it. |
We are experiencing the same thing on a lot of our apps at the moment. Today one of our apps actually got rejected. Has anyone tested whether this issue occurs on the 5.0.0 alpha package? |
I haven't had time to look at this issue (or been able to reproduce it yet). I've kind of been working on it indirectly - This PR ensures Sentry.Maui is trim compatible... once that's merged, we could put together another pre-release to see if it has any impact on this issue. There's also one other change in the version 5.0.0 branch that relates to issues reading the network status, so that could potentially be related. Again, we could test that in the next pre-release. Apologies for the wait on this - we're a bit short handed on the .NET SDK at the moment. |
@drewrobey from what I can tell, AOT isn't yet supported on Android: The tracking issues there seem to have a .NET 10.0 milestone:
In our own samples, we only enable this for sentry-dotnet/samples/Sentry.Samples.Maui/Sentry.Samples.Maui.csproj Lines 48 to 50 in a421af5
|
@jamescrosswell That's interesting. Doing some further reading it turns out full AOT for Android does indeed not exist, but partial AOT does, which would explain why the AOT build option has been in there for Android since the Xamarin days:
FYI there have been a couple of Maui framework Nuget updates in the last couple of days, that I'm currently experimenting with - let me see if these have any effect on this bug, as there's a lot of changes happening all of a sudden, and I need to isolate some variables to ensure I'm not sending you on a wild goose chase. |
Package
Sentry
.NET Flavor
.NET
.NET Version
9.0
OS
Android
SDK Version
4.13.0
Self-Hosted Sentry Version
No response
Steps to Reproduce
Expected Result
App should not crash.
Actual Result
As per Keren from Sentry's request I've created this issue, he's my original support message:
I'm using Sentry with .Net Maui, and I think I may have discovered a bug.
We've been receiving SEGFAULT runtime errors - apps crashing after maybe 20 seconds of startup, triggered by NETWORK_CAPABILITIES_CHANGED and BATTERY_CHANGED events. This problem has been reported by someone else to the Maui team via Github, and I've been helping to investigate the issue dotnet/maui#25446
I've discovered that the common denominator with all users having these problems is that they're using Sentry.Maui
When we remove Sentry from our builds the crashes stop. When we add Sentry back in, and remove AOT and trimming, the crashes stop. It looks like the Maui compilation linker is trimming certain methods from the Sentry plugin, which is causing the crashes, as these methods are clearly being called somewhere, possibly being called via Reflection or the like.
Perhaps it's possible to have Sentry's classes marked with directives to prevent trimming, so that they're preserved in-full during compilation?
The text was updated successfully, but these errors were encountered: