-
-
Notifications
You must be signed in to change notification settings - Fork 213
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
Suppress Native SIGSEGV signal errors on Android #3903
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's quite unfortunate since now users will be blind of native crashes.
@filipnavara any chance you can think of a better way? |
I'll think about it. That said, I observed it and never really considered it a bug... NRE in .NET is almost never intentional, so this essentially just caused double reporting. Depending on .NET runtime used (NativeAOT vs MonoVM) this may contain some useful information. |
Thanks @filipnavara - I think that's a perfectly valid perspective. Currently this PR simply suppresses all SIGSEGV exceptions... which runs the risk of suppressing some that come from native code (and aren't reported as NREs). We've got two sub-optimal options at this point:
I think we have to pick one of those as the default behaviour, at the very least. But potentially we could expose an option to let SDK users override the default choice we make, depending on whether they prefer to catch all/every error (but possibly some twice) or whether they're happy to let a few slip through the cracks but prevent duplicates. |
What about providing an option to control whether or not segfaults are suppressed. If they are annoying and not providing value to the user, disable them otherwise leave them on. In my experience, segfaults were a rare thing so I would still want to see them in most cases. |
I'm of two minds about this... not so much surfacing an option (which I think is probably a good idea) but what the default should be for that option (to suppress or not to suppress). Any managed NullReferenceException is resulting in a SIGSEGV Segfault being captured by our native SDK... so these are not all that uncommon (evidenced by the fact that we've had quite a few users reach out about this). Those users obviously find it irritating to get both a NullReferenceException and a SIGSEGV error reported/captured and I'm sure we'd get less issues in GitHub if the default behaviour was to suppress these. On the other hand, I think it would be safer to capture these so that people have visibility, by default... and let them deliberately suppress if they want to. Then at least they'd be aware of the dangers/risks in doing so. So maybe a bit more work for us, but safer for SDK users. |
See #3902:
Resolves #3837
Resolves #3898
Resolves #3935
This PR uses the Native BeforeSend callback on Android to intercept and suppress SIGSEGV errors, as these duplicate managed NullReferenceExceptions.
There's a small risk we're suppressing native SIGSEGV errors that are not wrapped by managed exceptions, but there's no easy way around that for the time being. This is the short term workaround described in #3902
In case SDK users see this as a problem though, we've added an option to let them control whether or not to suppress SIGSEGV Segfault errors.
Usage
This should be documented. See: