Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IOS & Android] Missing IL2CPP Line Number Information #1346

Open
ernesernesto opened this issue May 30, 2023 · 24 comments
Open

[IOS & Android] Missing IL2CPP Line Number Information #1346

ernesernesto opened this issue May 30, 2023 · 24 comments
Labels
Bug Something isn't working

Comments

@ernesernesto
Copy link

Environment

How do you use Sentry?
Sentry SaaS (sentry.io)

Which version of the SDK?
1.2.0

How did you install the package? (Git-URL, Assetstore)
Git-URL

Which version of Unity?
2021.3.24f1

Is this happening in Unity (editor) or on a player like Android, iOS, Windows?
Issue happening on IOS and Android device

Steps to Reproduce

Trigger exception on device (iphone and android)

Expected Result

Actual c# line number should be shown on sentry page

Actual Result

No info on actual line number, only filename and function that is having the exception

Notes or comments

  • From unity build log, unity is invoking il2cpp with these arguments
    Invoking il2cpp with arguments: --convert-to-cpp --emit-null-checks --enable-array-bounds-check --dotnetprofile="unityaot-macos" --cachedirectory=REDACTED --additional-cpp=REDACTED --additional-cpp=REDACTED --avoid-dynamic-library-copy --dont-deploy-baselib --profiler-report --emit-source-mapping --directory=REDACTED --generatedcppdir=REDACTED --stats-output-dir=REDACTED --convert-in-graph
  • Sentry CLI is run with these arguments
    "./sentry-cli-Darwin-universal" "upload-dif" "--il2cpp-mapping" "--include-sources" REDACTED
  • Symbols and sources uploaded, all this is done automatically by xcode / gradle build process
  • On IOS Bitcode is disabled
  • sentry properties
    defaults.org=REDACTED defaults.project=REDACTED auth.token=REDACTED dif.max_item_size=10485760 log.level=info

Any logs or screenshots

Settings for unity ios build settings
unity_ios_settings

Settings for unity android build settings
unity_android_settings

IL2CPP line numbers is ticked
Screen Shot 2023-05-30 at 21 42 06

Upload symbols is ticked (Dev and Sources)
Screen Shot 2023-05-30 at 21 42 00

Event on ios not showing correct line number
exception_ios

Event on android not showing correct line number
exception_android

Symbols uploaded on ios events
symbols_uploaded_ios

Symbols uploaded on android events (this is weird since it's a different event id with the same root cause issues but when I clicked show detail window it's showing ios unity framework)
Screen Shot 2023-05-30 at 22 46 39

Upload symbol log for ios
ios_sentry-symbols-upload.log

Upload symbol log for android
android_sentry-symbols-upload.log

I could also provide the event link via mail if the sentry team needs that

Thanks!

@bitsandfoxes
Copy link
Contributor

Hey @ernesernesto. Thanks for the amazingly detailed issue. I'll take a look asap.

@bitsandfoxes bitsandfoxes added Bug Something isn't working and removed Status: Untriaged labels May 30, 2023
@bitsandfoxes
Copy link
Contributor

The links to the issue would be helpful. Could you send it to stefan@sentry.io?

@ernesernesto
Copy link
Author

@bitsandfoxes sent to your mail, thanks!

@ernesernesto
Copy link
Author

@bitsandfoxes hello, any new info for this?

@bitsandfoxes
Copy link
Contributor

Hey @ernesernesto. I can reproduce issues with the line numbers locally and we're actively looking into fixing that.

@ernesernesto
Copy link
Author

@bitsandfoxes that's great to hear! what's the actual problem? Is there anything that I can do on my end (downgrading or disabling some settings in order for il2cpp line number to work), or I just need to wait for the fix to come in?

@bitsandfoxes
Copy link
Contributor

I'm really not sure at this point. One issue I identified is the SDK reporting a wrong/malformed debug ID. I'm still in the process of isolating the root cause.
That part of the SDK has not changed in quite some time so I suspect the issue either originating in a change in Unity's IL2CPP part or our symbolication.

@bitsandfoxes
Copy link
Contributor

@ernesernesto: Digging into it a bit more:
Android: The debug IDs don't seem to match up between the event you shared with me and the logs. Did you manually remove them?

@ernesernesto
Copy link
Author

@bitsandfoxes I was trying to figure out which one is the correct lib used for symbolication, hence I deleted it one by one before uploading and triggering the test. Here's the step that I did,

  1. delete all uploaded symbols on the dashboard
  2. build ios (symbols will automatically uploaded)
  3. build android (symbols will automatically uploaded)
  4. trigger error on ios
  5. trigger error on android

If I want to trigger it again in order for you to verify, would doing 2 - 5 enough? Or should I do steps 1 - 5?

I'll be retriggering the events again probably with the same exception but on different file, since it looks like it would be grouped into the same event if I triggered on the same source file. Let me know what you think so I could re-trigger it again

@bitsandfoxes
Copy link
Contributor

If I want to trigger it again in order for you to verify, would doing 2 - 5 enough? Or should I do steps 1 - 5?

That'd be amazing! Yes, it would. Thanks!

@ernesernesto
Copy link
Author

@bitsandfoxes I did steps 2-5, please check your mail, I've sent the latest symbols upload log and the event link, thanks!

@ernesernesto
Copy link
Author

@bitsandfoxes any new info?

@bitsandfoxes
Copy link
Contributor

I've been looking into this and it looks to me like there are two different issues.
On Android, the debug symbols are missing and the logs make no indication of why that might be.
And on iOS there is something off with the symbolication itself.
I'm going to need some help from a different team on this one.

@ernesernesto
Copy link
Author

Hi @bitsandfoxes looking for an updates if there's any :)

@bitsandfoxes
Copy link
Contributor

Hey @ernesernesto unfortunately, no. But it's not forgotten nor dropped.

@bitsandfoxes
Copy link
Contributor

I can finally reproduce this locally! Thank you so much for the repro @ernesernesto!

@dingleqiang
Copy link

dingleqiang commented Sep 13, 2023

Is this problem solved now?I reappear in this version 1.5.2 @bitsandfoxes

@bitsandfoxes
Copy link
Contributor

Is this problem solved now?I reappear in this version 1.5.2 @bitsandfoxes

Are you referring to a different issue than the known limitation related to button click events?

@dingleqiang
Copy link

Is this problem solved now?I reappear in this version 1.5.2 @bitsandfoxes

Are you referring to a different issue than the known limitation related to button click events?

Here is my test code:

private void Start()
{
    Debug.Log("This is a info");
    Debug.LogWarning("This is a warning");
    Debug.LogError("This is a error");
    Debug.LogException(new Exception("This is a Exception"));
    TestMethod1();
}

private void TestMethod1()
{
    TestMethod();
}

private void TestMethod()
{
    foreach (var VARIABLE in "COLLECTION")
    {
        GetComponent<Rigidbody>().drag = 12;//Rigidbody component is null
    }
}

@bitsandfoxes
Copy link
Contributor

Thanks for providing the repro @dingleqiang. Are you on Unity 2021.3. as well?

@frikic
Copy link

frikic commented Dec 26, 2023

I can confirm same issue on Android and IOS using Unity 2022.3.14, any updates?

@bitsandfoxes
Copy link
Contributor

bitsandfoxes commented Jan 3, 2024

A thousand apologies. I missed the notification on this one. I'll update our docs to properly reflect the current limitations.
But to summarize it here: Events going through the logger do not have line numbers. It's possible to have the stacktrace show up on the event by enabling AttachStacktrace on the options.
As of right now, the IL2CPP line number feature requires an exception to go through the exception processor and retrieve the instruction addresses from Unity's IL2CPP backend. This includes Debug.LogException since Unity omits the stacktrace on the exception. Instead, it's recommended to use SentrySdk.CaptureException instead.

@frikic
Copy link

frikic commented Jan 11, 2024

So I need a bit of clarification then
"This includes Debug.LogException since Unity omits the stacktrace on the exception. Instead, it's recommended to use SentrySdk.CaptureException instead."

We need to use Debug.LogException or SentrySdk.CaptureException in order to make it work? exception that Unity throws do not work.

@bitsandfoxes
Copy link
Contributor

SentrySdk.CaptureException works and events captured through this should have correct stacktraces and line numbers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
Status: No status
Status: No status
Status: No status
Development

No branches or pull requests

4 participants