Open TimBurik opened 3 months ago
The issue is also reproduced when ApplicationNotResponding
is reported, no files are attached despite both logcat and custom attachments are configured.
Crash generated with parameter CrashType.Native is reported with mechanism signalhandler and contains no attachments;
I think this is similar to:
In both cases, Native crash reporting essentially skips all the .NET SDK processing.
Crash generated with parameter CrashType.JavaBackgroundThread is reported twice: one with mechanism UncaughtExceptionHandler and contains no attachments, and another with mechanism AppDomain.UnhandledException and contains both attachments;
I suspect the UncaughtExceptionHandler
is coming from Java and the AppDomain.UnhandledException
is coming from .NET.
@bitsandfoxes do you know what the expected behaviour is here?
Possibly relates to this (so maybe something that hasn't yet been implemented): https://github.com/getsentry/sentry-dotnet/blob/5fab09efd4204fd07d95c818df79f7aa71d61e88/src/Sentry/Platforms/Android/Extensions/AttachmentExtensions.cs#L5-L22
Once the exception has been reported by Java, is there any way the .NET SDK could be aware of this and suppress further reporting? Or conversely, is there any way for the Java SDK to know this exception would be reported by the .NET SDK and so could safely ignore it?
I might have gotten that wrong but I was under the impression that the .NET SDK would be responsible for managed code and the Java SDK would provide native support. Having the same exception reported via the UncaughtExceptionHandler
in Java and the AppDomain.UnhandledException
is not ideal. But the reporting SDK is part of the event details.
I was under the impression that the .NET SDK would be responsible for managed code and the Java SDK would provide native support.
That's true, but you can add things to the scope (including attachments) that you want/expect to be sent with both Managed and Native exceptions. This hasn't been implemented for Attachments on Android yet.
Just as an update:
Crash generated with parameter CrashType.JavaBackgroundThread is reported twice: one with mechanism UncaughtExceptionHandler and contains no attachments, and another with mechanism AppDomain.UnhandledException and contains both attachments;
This is being addressed by PR #3756
Crash generated with parameter CrashType.Native is reported with mechanism signalhandler and contains no attachments;
This is going to be tackled separately on another PR, as these two issues are not related directly
Package
Sentry
.NET Flavor
.NET
.NET Version
8.0.303
OS
Android
SDK Version
4.10.1
Self-Hosted Sentry Version
No response
Steps to Reproduce
SentrySdk.CauseCrash()
with different parametersExpected Result
All reported events should have
logcat.log
attachment with logcat logs and customfile.txt
file attachment.Actual Result
CrashType.Native
is reported with mechanismsignalhandler
and contains no attachments;CrashType.JavaBackgroundThread
is reported twice: one with mechanismUncaughtExceptionHandler
and contains no attachments, and another with mechanismAppDomain.UnhandledException
and contains both attachments;CrashType.Managed
,CrashType.ManagedBackgroundThread
,CrashType.Java
) are reported with mechanismAppDomain.UnhandledException
and contain both attachments.This issue might be related to #3461
Reproduction sample: SampleProject.zip