getsentry / sentry-unity

Development of Sentry SDK for Unity
https://docs.sentry.io/platforms/unity/
MIT License
208 stars 50 forks source link

Add stacktrace from all threads when reporting ANR #923

Open rthery opened 2 years ago

rthery commented 2 years ago

If the thread where the ANR occurred was locked by something else, we have no way to see the state of the application across all the thread to investigate at the moment.

This could help, for inspiration you can check how it's done in Google Play Console.

bitsandfoxes commented 2 years ago

hey @rthery, thanks for bringing this up. I can see you point. let me get back to you.

bruno-garcia commented 2 years ago

I'm afraid this isn't possible in .NET We do this on Android ANRs, because with the Java we can get the stacktrace of all threads, but to my knowledge, we can't do this via C#

rthery commented 2 years ago

Ah yes I understand this can't be done for C# code, but when I was looking at issues of ANR reported from our Unity Android app on Sentry, I only saw one stacktrace of java code. (Also my top 3 three ANRs on Sentry were completely different than the ones listed on Google Play Console, for the same version and time period)

bitsandfoxes commented 2 years ago

So this is about Java? We have to check for AttachThreads when setting the Android options during the build. It should be the default behavior. Let me take a look.