firebase-unity-sdk icon indicating copy to clipboard operation
firebase-unity-sdk copied to clipboard

[Bug] Crash on Quit when using Analytics, Crashlytics, and Remote Config

Open a-maurice opened this issue 2 years ago • 3 comments

[REQUIRED] Please fill in the following fields:

  • Unity editor version: unity 2020.3.22f1 (but seems like all)
  • Firebase Unity SDK version: Since 8.6.1
  • Source you installed the SDK: unitypackage
  • Problematic Firebase Component: Analytics, Crashlytics, and Remote Config
  • Other Firebase Components in use: N/A
  • Additional SDKs you are using: Unknown
  • Platform you are using the Unity editor on: Mac
  • Platform you are targeting: Android
  • Scripting Runtime: IL2CPP
  • Pre-built SDK from the website or open-source from this repo: Prebuilt

[REQUIRED] Please describe the issue here:

(Please list the full steps to reproduce the issue. Include device logs, Unity logs, and stack traces if available.)

Steps to reproduce:

One of the issues flagged in https://github.com/firebase/quickstart-unity/issues/1193#issuecomment-1036330576. It seems like there is a problem when the application is shutting down that can result in a crash. There are a variety of users with different reports, but nothing concrete on reproduction steps, but the most relevant apis are Analytics, Crashlytics, and possibly Remote Config (though it isn't always included).

A possible way to reproduce the problem is adding a call to Unity's Application.Quit(), and watching the logs to see if anything odd appears.

a-maurice avatar Dec 12 '22 21:12 a-maurice

@a-maurice which call or logs should be added?

Meanwhile I can see such errors OnApplicationQuit after almost everything destroyed: For Unity 2021: `Crashed: Thread #1 SIGSEGV 0x000000000000013a 0 libunity.so JobQueue::WaitForJobGroupID(JobGroupID, JobQueue::JobQueueWorkStealMode)

1 libunity.so __ashldi3 2 libunity.so __ashldi3 3 libunity.so CompleteFenceInternal(JobFence&, WorkStealMode) 4 libunity.so AsyncUploadManager::~AsyncUploadManager() 5 libunity.so __ashldi3 6 libunity.so AsyncUploadManager::StaticDestroy(void*) 7 libunity.so RegisterRuntimeInitializeAndCleanup::ExecuteCleanup() 8 libunity.so UnityTimeToUnixTime(DateTime const&, long&) 9 libc.so (Missing UUID 98d22ed69dca1afbfed9c2da3b49ce91) 10 libunity.so RuntimeCleanup() 11 libunity.so operator delete(void*) 12 libunity.so unwindstack::MapInfo::~MapInfo() 13 libunity.so __ashldi3 14 libunity.so unwindstack::Maps::Clear() 15 libunity.so UnityFinalDeinitApplication() 16 libunity.so nativeDone(_JNIEnv*, _jobject*) 17 (Missing) 29 (Missing) 30 libunity.so __ashldi3 31 (Missing) 63 libart.so (Missing UUID b5fc7fc369f2cabea0a1e9a49518ab60)`

For Unity 2020 and earlier: `Crashed: Thread #1

SIGSEGV 0x0000000000000154

0 libunity.so nativeDone(_JNIEnv*, _jobject*)

1 libunity.so nativeDone(_JNIEnv*, _jobject*)

2 (Missing)`

shefich avatar Dec 12 '22 22:12 shefich

@shefich One potential setting that might help is adding:

Firebase.FirebaseApp.LogLevel = Firebase.LogLevel.Debug;

which will make the logs include more debug information. Though I suspect part of the fix will require deeper debugging, which is why we haven't been able to identify the root cause yet.

a-maurice avatar Dec 12 '22 22:12 a-maurice

Hi @a-maurice, "Firebase.LogLevel.Debug" doesn't helps to have more logs. Many errors connected too the "libmonochrome.so". Here's stacktrace with other thread/library: issue_b0331e86d965953967fab1ff4abe0d07_crash_session_63a91b24017c00015e2f1c6078cf81de_DNE_0_v2_stacktrace (1).txt

Tell me please, if it helps.

shefich avatar Dec 26 '22 13:12 shefich