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

Native stacktrace improvements

Open bitsandfoxes opened this issue 2 years ago • 2 comments

Example event image

To consider:

  • Frames from UnityPlayer should not be InApp
  • Frames within GameAssembly prefixed with il2cpp:: should not be InApp
  • Method name in frame should not be the one from C++ but C# instead

bitsandfoxes avatar Mar 20 '23 20:03 bitsandfoxes

I've had a look but have no idea where this is being set. @Swatinem ?

vaind avatar Mar 23 '23 16:03 vaind

The in_app flag is being set by the grouping algorithm. As you have two very specific rules here, its possible to add these to our default grouping enhancers.

The SDK teams had a recent push to update these rules which are defined in this file here: https://github.com/getsentry/sentry/blob/70d91c1d8fe89bd557b1aa9089353340fe22de59/src/sentry/grouping/enhancer/enhancement-configs/[email protected]

NOTE that this grouping config is not yet the default, so I believe its still okay to add things to the default rules without a new grouping version.

Method name in frame should not be the one from C++ but C# instead

I believe you are capturing a hard crash here? We can map the source position (and source context) via the il2cpp mapping file. But we do not have access to the C# names which are defined in C# metadata.

In the very early experimentation phase of il2cpp, I got a working prototype to correlate the C++ names with the C# names, but it is very complex, brittle, and requires access to more files to read data from. In the end it was not worth the large effort needed to support it, as for normal C# exceptions, the SDK will add a readable name at runtime.

Swatinem avatar Mar 24 '23 12:03 Swatinem