firebase / firebase/firebase-unity-sdk
[Bug] Unity Editor crashes intermittently due to Firebase Unity SDK
- Dominant language
- C#
- Stars
- 320
- Forks
- 60
- Avg merge
- 13h 32m
- Merged PRs (30d)
- 13
Description
### [REQUIRED] Please fill in the following fields:
* Unity editor version: 2021.3.28
* Firebase Unity SDK version: 11.3
* Source you installed the SDK: Unity Package Manager
* Problematic Firebase Component: Firebase.Functions
* Other Firebase Components in use: Firebase.App, Firebase.Analytics, Firebase.Firestore
* Additional SDKs you are using: Oculus SDK
* Platform you are using the Unity editor on: Windows
* Platform you are targeting: Android
* Scripting Runtime: IL2CPP
* Pre-built SDK from the https://firebase.google.com/download/unity
### [REQUIRED] Please describe the issue here:
Unity Editor crashes intermittently due to Firebase Unity SDK
#### Steps to reproduce:
Use firebase sdk code. In this use Firebase Functions and stop and start Unity regularly and trigger a firebase function on load. Unity Crashing due to Firebase has always been a semi regular frustration with using Unity SDK. Typically I turn off all Unity Firebase SDK code to prevent Unity from crashing while developing other aspects of our game
#### Relevant Code:
Stacktrack from Editor.log
```
========== OUTPUTTING STACK TRACE ==================
0x00007FF8096C1186 (FirebaseCppApp-11_3_0) uWS::HttpSocket<0>::upgrade
0x00007FF8096AAA7B (FirebaseCppApp-11_3_0) uWS::HttpSocket<0>::upgrade
0x00007FF8096AC183 (FirebaseCppApp-11_3_0) uWS::HttpSocket<0>::upgrade
0x00007FF80969C2E8 (FirebaseCppApp-11_3_0) uWS::HttpSocket<0>::upgrade
0x00007FF80965F054 (FirebaseCppApp-11_3_0) uWS::HttpSocket<0>::upgrade
0x00007FF809660521 (FirebaseCppApp-11_3_0) uWS::HttpSocket<0>::upgrade
0x00007FF80910B93B (FirebaseCppApp-11_3_0) uWS::WebSocket<0>::send
0x00007FF80910ACFC (FirebaseCppApp-11_3_0) uWS::WebSocket<0>::send
0x00007FF80901D6AD (FirebaseCppApp-11_3_0) uS::Socket::freeMessage
0x00007FF80910AEA0 (FirebaseCppApp-11_3_0) uWS::WebSocket<0>::send
0x00007FF80910AE19 (FirebaseCppApp-11_3_0) uWS::WebSocket<0>::send
0x00007FF808FF6620 (FirebaseCppApp-11_3_0) SWIGRegisterStringCallback_FirestoreCpp
0x0000025C48C428DB (Mono JIT Code) (wrapper managed-to-native) Firebase.Functions.FunctionsInternalPINVOKE:FirebaseFunctionsInternal_ReleaseReferenceInternal (System.Runtime.InteropServices.HandleRef)
0x0000025C48C427B3 (Mono JIT Code) Firebase.Functions.FirebaseFunctionsInternal:ReleaseReferenceInternal (Firebase.Functions.FirebaseFunctionsInternal)
0x0000025C48C4261B (Mono JIT Code) Firebase.Functions.FirebaseFunctionsInternal:Dispose (bool)
0x0000025C48C4255A (Mono JIT Code) Firebase.Functions.FirebaseFunctionsInternal:Dispose ()
0x0000025C48C42383 (Mono JIT Code) Firebase.Functions.FirebaseFunctions:Dispose ()
0x0000025C48C421CB (Mono JIT Code) Firebase.Functions.FirebaseFunctions:Finalize ()
0x0000025B8D36E58C (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_virtual_void__this__ (object,intptr,intptr,intptr)
0x00007FF824950855 (mono-2.0-bdwgc) [C:\build\output\Unity-Technologies\mono\mono\metadata\gc.c:383] mono_gc_run_finalize
0x00007FF82495190E (mono-2.0-bdwgc) [C:\build\output\Unity-Technologies\mono\mono\metadata\gc.c:944] finalize_domain_objects
0x00007FF824951E83 (mono-2.0-bdwgc) [C:\build\output\Unity-Technologies\mono\mono\metadata\gc.c:1036] finalizer_thread
0x00007FF8248ECF7B (mono-2.0-bdwgc) [C:\build\output\Unity-Technologies\mono\mono\metadata\threads.c:1268] start_wrapper_internal
0x00007FF8248ED156 (mono-2.0-bdwgc) [C:\build\output\Unity-Technologies\mono\mono\metadata\threads.c:1344] start_wrapper
0x00007FF8BD4626AD (KERNEL32) BaseThreadInitThunk
0x00007FF8BF2AAA68 (ntdll) RtlUserThreadStart
========== END OF STACKTRACE ===========
```
Contributor guide
Research direction
Start with the supplied Editor.log stack trace and reproduce the crash by stopping and starting Unity while triggering Firebase.Functions on load. Inspect the Firebase.Functions Dispose and Finalize path alongside the native uWS calls shown in the trace. Done means the intermittent Unity Editor crash is reproduced and its cause or a confirmed fix is documented for the listed versions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, firebase, unity
- Domain
- desktop-dev, mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100