sentry-unity
sentry-unity copied to clipboard
[IOS & Android] Missing IL2CPP Line Number Information
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
Settings for unity android build settings
IL2CPP line numbers is ticked
Upload symbols is ticked (Dev and Sources)
Event on ios not showing correct line number
Event on android not showing correct line number
Symbols uploaded on ios events
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)
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!
Hey @ernesernesto. Thanks for the amazingly detailed issue. I'll take a look asap.
The links to the issue would be helpful. Could you send it to [email protected]?
@bitsandfoxes sent to your mail, thanks!
@bitsandfoxes hello, any new info for this?
Hey @ernesernesto. I can reproduce issues with the line numbers locally and we're actively looking into fixing that.
@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?
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.
@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?
@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,
- delete all uploaded symbols on the dashboard
- build ios (symbols will automatically uploaded)
- build android (symbols will automatically uploaded)
- trigger error on ios
- 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
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!
@bitsandfoxes I did steps 2-5, please check your mail, I've sent the latest symbols upload log and the event link, thanks!
@bitsandfoxes any new info?
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.
Hi @bitsandfoxes looking for an updates if there's any :)
Hey @ernesernesto unfortunately, no. But it's not forgotten nor dropped.
I can finally reproduce this locally! Thank you so much for the repro @ernesernesto!
Is this problem solved now?I reappear in this version 1.5.2 @bitsandfoxes
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?
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
}
}
Thanks for providing the repro @dingleqiang. Are you on Unity 2021.3.
as well?
I can confirm same issue on Android and IOS using Unity 2022.3.14, any updates?
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.
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.
SentrySdk.CaptureException
works and events captured through this should have correct stacktraces and line numbers.