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

IL2CPP line number incorrect on some platforms

Open bitsandfoxes opened this issue 2 years ago • 8 comments

From tests of 0.22.0 and Unity 2020.3.37f1 with our dogfooding game: The feature works on iOS as expected.

An issue on Android: Only displays C++ line numbers: https://sentry.io/organizations/sentry/issues/3464200251/events/d61109bbe5d14daf852ec50da4f98504/?project=5905698&query=is%3Aunresolved

A similar issue on the main branch: Only displays C++ line numbers:

Windows on Unity 2021.3.7f1: https://sentry.io/organizations/sentry-sdks/issues/3463873374/events/7ea51475921f4ed19e5af22857b1a306/?project=5439417

Android on Unity 2020.3.37f1: https://sentry.io/organizations/sentry-sdks/issues/3261854748/events/bf65b11404ae4b478d1ea6745d62d51c/?project=5439417

bitsandfoxes avatar Jul 29 '22 18:07 bitsandfoxes

The Android event has source context, and makes it obvious why the mapping fails:

grafik

I can take a closer look at the debug info for this particular function, but it might as well be possible that the way C++ exceptions work, they will point to other places in the C++ code.

Swatinem avatar Aug 01 '22 08:08 Swatinem

Can you by any chance look at the generated code for the other examples?

I wonder why that code is not being uploaded. Probably we are running into the file size limit that we discovered recently. @kamilogorek Can you remind me which CLI option I need to update (via config file, or via cli flag?) to upload larger files? I bet these generated C++ files can be huge.

Swatinem avatar Aug 01 '22 08:08 Swatinem

It's dif.max_item_size=1048576 with properties file, or if using ini

[dif]
max_item_size=1048576

(with 1024*1024 being a default 1MB).

https://docs.sentry.io/product/cli/configuration/#configuration-values

kamilogorek avatar Aug 01 '22 09:08 kamilogorek

The size limit might be the culprit because just looking at the largest files in our sample app:

image

However, doesn't the CLI print any warnings when it's skipping files due to the limit? I think I would have noticed that and it would have saved a lot of time if it really is the issue.

vaind avatar Aug 01 '22 12:08 vaind

CLI currently does not print any warning when it skips the files prior to upload.

kamilogorek avatar Aug 01 '22 13:08 kamilogorek

so updating the max_item_size indeed fixes the issue for Windows Unity 2021 build: https://sentry.io/organizations/sentry-sdks/issues/3464053353/events/01be4c17c231430f8ceae02abefa3dc0/?project=5439417

It is still c++ instead of the expected c#, though image

Maybe it's because for some reasons the c# sources don't get uploaded? I can't access the uploaded files on https://sentry.io/settings/sentry-sdks/projects/sentry-unity/debug-symbols/ so can't tell what's really in there.

vaind avatar Aug 01 '22 13:08 vaind

In that case il2cpp does not seem to generate a line mapping, so there is nothing we can do :-(

Swatinem avatar Aug 01 '22 14:08 Swatinem

CLI currently does not print any warning when it skips the files prior to upload.

Is this something you could add @kamilogorek ? Seems like it took some effort to find out what happened because there was no logging.

In that case il2cpp does not seem to generate a line mapping, so there is nothing we can do :-(

@Swatinem we can raise an issue with Unity if we can give them a repro. But we need a way to document this behavior for the current versions as this will be a source of bug reports

bruno-garcia avatar Aug 01 '22 16:08 bruno-garcia

Closing this as 0.22.1 seems to have resolved this issue. Thanks, everyone!

bitsandfoxes avatar Aug 18 '22 15:08 bitsandfoxes