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

[Bug] ANR traces are not symbolicated #1280

Open
AntonPetrov83 opened this issue May 23, 2022 · 5 comments
Open

[Bug] ANR traces are not symbolicated #1280

AntonPetrov83 opened this issue May 23, 2022 · 5 comments

Comments

@AntonPetrov83
Copy link

AntonPetrov83 commented May 23, 2022

[REQUIRED] Please fill in the following fields:

  • Unity editor version: 2020.3.32f1
  • Firebase Unity SDK version: 8.8.0
  • Source you installed the SDK: .unitypackage
  • Problematic Firebase Component: Crashlytics
  • Other Firebase Components in use: Analytics
  • Additional SDKs you are using: Facebook, Singular, AppLovin MAX SDK, AdMob, ironSource, AdColony,
  • Platform you are using the Unity editor on: Windows 11 Pro
  • Platform you are targeting: Android
  • Scripting Runtime: IL2CPP

[REQUIRED] Please describe the issue here:

I can see my ANR in the Crashlytics but it is not symbolicated:
image

As a text:
image

Steps to reproduce:

It is 100% reproducible.

  1. I am building the game locally;
  2. Then I upload symbols using Firebase CLI and it works as expected: Crashlytics symbol file uploaded successfully;
  3. Then I run the game and generate an ANR making an infinite loop in the main thread.
  4. I see my ANR report in the Firebase Crashlytics but it is not symbolicated.

The interesting part:

I used Unity's Stacktrace Utility (comes with Android Logcat package) to symbolicate this stack trace using the same symbols I uploaded earlier to Crashlytics and it works as expected:
image

Under the hood this utility uses addr2line so I guess this proves that this trace definitely can be symbolicated!

@paulinon
Copy link
Contributor

Hi @AntonPetrov83,

Thanks for reporting this issue. Version 9.0.0 of the SDK has been released recently. Could you verify if this version makes any difference? Otherwise, please provide a minimal, reproducible example of your implementation along with the complete steps to reproduce the issue so that we can identify what's causing this behavior.

@paulinon paulinon added the needs-info Need information for the developer label May 23, 2022
@AntonPetrov83
Copy link
Author

AntonPetrov83 commented May 24, 2022

Hi @paulinon,

I have upgraded Firebase Crashlytics to 9.0.0, I have upgraded Firebase CLI to 11.0.0, I have successfully uploaded symbols and triggered an ANR - still nothing :(

image

UPDATE:

So, it is 100% reproducible.

  1. Take the test app quickstart-unity/crashlytics/testapp and open it with Unity 2020.3.32f1 (LTS);
  2. Follow general setup instructions to enable Crashlytics in Firebase Console;
  3. Modify UIHandler.cs to add new "Trigger ANR" button like this:
    public void TriggerAnr() {
      DebugLog("Triggering an ANR. Wait for system popup and Close the App");
      AndroidJavaClass unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
      AndroidJavaObject activity = unityPlayer.GetStatic<AndroidJavaObject>("currentActivity");
      activity.Call("runOnUiThread", new AndroidJavaRunnable(InfiniteLoopOnMainThread));
    }

    void InfiniteLoopOnMainThread() {
      while (true) ;
    }

    void GUIDisplayControls() {
      ...
        if (GUILayout.Button("Trigger ANR")) {
          TriggerAnr();
        }
      ...
    }
  1. Build Android build with "Create symbols.zip" enabled;
  2. Upload symbols using Firebase CLI;
  3. Run the app, trigger an ANR, wait for ANR dialog and close the app;
  4. Run again to send crashlytics;
  5. See the bug:
    image

@google-oss-bot google-oss-bot added needs-attention Need Googler's attention and removed needs-info Need information for the developer labels May 24, 2022
@paulinon
Copy link
Contributor

paulinon commented May 24, 2022

Thanks for the additional information, @AntonPetrov83. I've replicated the issue using the steps you provided, and I'll relay this to the team. I also noticed that the ANR isn't reported when it's coming from a device with a lower Android version (in my case, Android 9).

I'll be marking this as a bug for now, but you may refer to this thread for updates.

@paulinon paulinon added type: bug and removed type: question needs-attention Need Googler's attention labels May 24, 2022
@samedson
Copy link

Hey @AntonPetrov83, right now Crashlytics isn't able to symbolicate ANRs, but we are working on it. I don't have a TBD yet but will update here when we get it released.

@khambadkone
Copy link

@paulinon There was an announcement at the Games Developer Summit that symbolication of native Android ANRs is now supported. Wouldn't it solve this issue ? What version of Crashlytics has this support?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants