sentry-unity icon indicating copy to clipboard operation
sentry-unity copied to clipboard

Add stacktrace from all threads when reporting ANR

Open rthery opened this issue 3 years ago • 4 comments
trafficstars

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.

rthery avatar Aug 02 '22 07:08 rthery

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

bitsandfoxes avatar Aug 04 '22 19:08 bitsandfoxes

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#

bruno-garcia avatar Aug 09 '22 00:08 bruno-garcia

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)

rthery avatar Aug 09 '22 15:08 rthery

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.

bitsandfoxes avatar Aug 09 '22 15:08 bitsandfoxes