firebase / firebase-ios-sdk

Firebase SDK for Apple App Development
https://firebase.google.com
Apache License 2.0
5.59k stars 1.46k forks source link

Crash on iOS 12 (happens on 50%+ of sessions) #11642

Closed UlulabDev closed 5 months ago

UlulabDev commented 1 year ago

Description

Since our last app update, we are getting a lot of crash reports from Apple. Crashlytics and our own custom crash handling system don't see this crash, so it went undetected for months. As the call stack shows, it happens in the awake of a manager class so it's really early on in the lifecycle of a session. This crash only occurs for iOS 12 - further iOS versions never trigger this issue. We are getting more reports recently of iPads on iOS 16 hanging, but we don't know if this is related to this issue or not.

At least 50% of sessions on iOS 12 have got this crash, so it's pretty critical.

Unfortunately I don't have a good explanation as to why this crash started with this version only. We resolved dependencies in Unity to update the version of a different package (RevenueCat), and that did update the ExternalDependencyManager from version 1.2.175 to version 1.2.176. Not sure which libraries were changed on iOS as a result of this though.

The call stack seems to point to firebase. So my best guess is that this change in dependency manager version got another version of iOS libraries, which now causes the crash.

Reproducing the issue

We will soon be getting a device that can run iOS 12 to try and repro, but we don't have one at the moment so we can't repro. So far these statistics are coming from App Store Connect.

Note: I'm not entirely sure if the list of Firebase services is 100% accurate.

Firebase SDK Version

9.1.0

Xcode Version

13.4.1

Installation Method

CocoaPods

Firebase Product(s)

Analytics, App Check, Crashlytics, Installations

Targeted Platforms

iOS

Relevant Log Output

This is the code in our Awake function which is part of the callstack below:

private void Awake()
    {
        // This should not be necessary as it is supposed to be true by default.
        // It has been noted somewhere that never calling this may result in Firebase not working due to a bug.
        FirebaseAnalytics.SetAnalyticsCollectionEnabled(true);

        //From https://firebase.google.com/docs/unity/setup#confirm-google-play-version
        FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task =>
        {
            var dependencyStatus = task.Result;
            if (dependencyStatus == DependencyStatus.Available)
            {
                // Create and hold a reference to your FirebaseApp,
                // where app is a Firebase.FirebaseApp property of your application class.
                app = FirebaseApp.DefaultInstance;

                delayedMessages.Enqueue("Firebase is Initialized");
            }
            else
            {
                delayedMessages.Enqueue($"Could not resolve all Firebase dependencies: {dependencyStatus}");
            }
        });
    }

Call stack:

UnityFramework: specialized _NativeDictionary.mutatingFind(_:isUnique:) + 128
#23 (null) in specialized _NativeDictionary.ensureUnique(isUnique:capacity:) ()
#24 (null) in specialized _NativeDictionary.mutatingFind(_:isUnique:) ()
#25 (null) in specialized _NativeDictionary.setValue(_:forKey:isUnique:) ()
#26 (null) in specialized Dictionary._Variant.setValue(_:forKey:) ()
#27 (null) in specialized Dictionary.subscript.setter ()
#28 0x00000001007a038c in specialized static HeartbeatStorage.getInstance(id:) at /Users/ululabbuild/repos/numbers/BuildsProd/Pods/FirebaseCoreInternal/FirebaseCore/Internal/Sources/HeartbeatLogging/HeartbeatStorage.swift:64
#29 0x0000000100792b60 in static HeartbeatStorage.getInstance(id:) at /Users/ululabbuild/repos/numbers/BuildsProd/Pods/FirebaseCoreInternal/FirebaseCore/Internal/Sources/HeartbeatLogging/HeartbeatController.swift:45
#30 0x0000000100792b60 in HeartbeatController.__allocating_init(id:dateProvider:) at /Users/ululabbuild/repos/numbers/BuildsProd/Pods/FirebaseCoreInternal/FirebaseCore/Internal/Sources/HeartbeatLogging/HeartbeatController.swift:36
#31 (null) in HeartbeatController.__allocating_init(id:) ()
#32 (null) in specialized _ObjC_HeartbeatController.init(id:) ()
#33 (null) in _ObjC_HeartbeatController.init(id:) ()
#34 (null) in @objc _ObjC_HeartbeatController.init(id:) ()
#35 0x000000010078eed8 in -[FIRHeartbeatLogger initWithAppID:userAgentProvider:] at /Users/ululabbuild/repos/numbers/BuildsProd/Pods/FirebaseCore/FirebaseCore/Sources/FIRHeartbeatLogger.m:52
#36 0x000000010078ee2c in -[FIRHeartbeatLogger initWithAppID:] at /Users/ululabbuild/repos/numbers/BuildsProd/Pods/FirebaseCore/FirebaseCore/Sources/FIRHeartbeatLogger.m:44
#37 0x000000010078b2a8 in -[FIRApp initInstanceWithName:options:] at /Users/ululabbuild/repos/numbers/BuildsProd/Pods/FirebaseCore/FirebaseCore/Sources/FIRApp.m:342
#38 0x000000010078a9b8 in +[FIRApp configureWithName:options:] at /Users/ululabbuild/repos/numbers/BuildsProd/Pods/FirebaseCore/FirebaseCore/Sources/FIRApp.m:204
#39 0x000000010078a6ac in +[FIRApp configureWithOptions:] at /Users/ululabbuild/repos/numbers/BuildsProd/Pods/FirebaseCore/FirebaseCore/Sources/FIRApp.m:146
#40 (null) in invocation function for block in firebase::(anonymous namespace)::CreatePlatformApp(firebase::AppOptions const&, char const*) ()
#41 (null) in firebase::(anonymous namespace)::CreatePlatformApp(firebase::AppOptions const&, char const*) ()
#42 (null) in firebase::(anonymous namespace)::CreateOrGetPlatformApp(firebase::AppOptions const&, char const*) ()
#43 (null) in firebase::App::Create(firebase::AppOptions const&, char const*) ()
#44 (null) in firebase::App::Create(firebase::AppOptions const&) ()
#45 (null) in firebase::App::Create() ()
#46 (null) in firebase::AppCreate(firebase::AppOptions const*, char const*) ()
#47 (null) in firebase::AppGetOrCreateInstance(firebase::AppOptions const*, char const*) ()
#48 (null) in firebase_App_CreateInternal__SWIG_0() ()
#49 (null) in Firebase_App_CSharp_FirebaseApp_CreateInternal__SWIG_0 ()
#50 0x000000010190f148 in AppUtilPINVOKE_FirebaseApp_CreateInternal__SWIG_0_m8C61ECBE5407D4A591827E10595AE28EFE8C6CE5 at /Users/ululabbuild/repos/numbers/BuildsProd/Classes/Native/Firebase.App.cpp:30894
#51 0x000000010190f148 in FirebaseApp_CreateInternal_m63EB3F64189DA8E6C5B2E1C95B11D63EF7F7BC4B at /Users/ululabbuild/repos/numbers/BuildsProd/Classes/Native/Firebase.App.cpp:22376
#52 0x000000010190b348 in CreateDelegate_Invoke_m3C05F10053C0FD938376079571835049ADDD6186_inline(CreateDelegate_tC2B37930B020E09BB7E6EBC451C2864B0B29DE73*, MethodInfo const*) at /Users/ululabbuild/repos/numbers/BuildsProd/Classes/Native/Firebase.App.cpp:34738
#53 0x000000010190b348 in FirebaseApp_CreateAndTrack_m3EFC2B1BFE4FF3BE069B04DE63E93A257CD65B3E at /Users/ululabbuild/repos/numbers/BuildsProd/Classes/Native/Firebase.App.cpp:20829
#54 0x00000001018f3740 in FirebaseAnalytics__cctor_mC245C283209D04E164172DD540ACA071E394B5F0 at /Users/ululabbuild/repos/numbers/BuildsProd/Classes/Native/Firebase.Analytics.cpp:5814
#55 0x00000001014c73dc in il2cpp::vm::Runtime::InvokeWithThrow(MethodInfo const*, void*, void**) ()
#56 0x00000001014c723c in il2cpp::vm::Runtime::Invoke(MethodInfo const*, void*, void**, Il2CppException**) ()
#57 0x00000001014c576c in il2cpp::vm::Runtime::ClassInit(Il2CppClass*) ()
#58 0x00000001016c10bc in il2cpp_codegen_runtime_class_init_inline(Il2CppClass*) ()
#59 0x00000001016c10bc in FirebaseManagerBhvr_Awake_m6030513E14DEEBF484F7BC0FF2F9D807C36D4203 at /Users/ululabbuild/repos/numbers/BuildsProd/Classes/Native/Assembly-CSharp1.cpp:17982
#60 0x00000001014c73dc in il2cpp::vm::Runtime::InvokeWithThrow(MethodInfo const*, void*, void**) ()
#61 0x00000001014c723c in il2cpp::vm::Runtime::Invoke(MethodInfo const*, void*, void**, Il2CppException**) ()
#62 0x0000000100c18ae8 in scripting_method_invoke(ScriptingMethodPtr, ScriptingObjectPtr, ScriptingArguments&, ScriptingExceptionPtr*, bool) ()
#63 0x0000000100c248dc in ScriptingInvocation::Invoke(ScriptingExceptionPtr*, bool) ()
#64 0x0000000100c275d8 in Invoke ()
#65 0x0000000100c275d8 in ScriptingInvocation::InvokeChecked(ScriptingExceptionPtr*) ()
#66 0x0000000100c69c48 in SerializableManagedRef::CallMethod(Object&, ScriptingMethodPtr) ()
#67 0x0000000100c35aec in CallMethodInactive ()
#68 0x0000000100c35aec in MonoBehaviour::CallAwake() ()
#69 0x0000000100c35f20 in MonoBehaviour::AddToManager() ()
#70 (null) in MonoBehaviour::AwakeFromLoad(AwakeFromLoadMode) ()
#71 0x0000000100c6b264 in AwakeFromLoadQueue::InvokeAwakeFromLoad(AwakeFromLoadQueue::Item*, unsigned int, AwakeFromLoadMode) ()
#72 0x0000000100c6b12c in AwakeFromLoadQueue::AwakeFromLoadAllQueues(AwakeFromLoadMode, bool) ()
#73 0x0000000100a956c0 in AwakeFromLoad ()
#74 0x0000000100a956c0 in GameObject::ActivateAwakeRecursively(DeactivateOperation) ()
#75 0x0000000100a02bdc in GameObject_CUSTOM_SetActive(ScriptingBackendNativeObjectPtrOpaque*, unsigned char) ()
#76 0x0000000101890844 in GameLoaderBhvr_U3CGameLoaderRoutineU3Eb__6_12_mD2571AB5D64980EC6B23A5512C93FD0DEBAC614B at /Users/ululabbuild/repos/numbers/BuildsProd/Classes/Native/Assembly-CSharp6.cpp:34515
#77 0x0000000101a98754 in Option_Map_TisUnit_t135B1E794A325E2D5D5BE5F538101F2019378104_TisRuntimeObject_mBBE9EDCCB89FCB2531CDF4621175BBD4A9F5E0C9_gshared at /Users/ululabbuild/repos/numbers/BuildsProd/Classes/Native/GenericMethods18.cpp:36680
#78 0x0000000101c639d4 in U3CU3Ec__DisplayClass40_0_2_U3CMapU3Eb__0_m9AB914918F77BF3D81042A15DC410D5D6DE2F20A_gshared at /Users/ululabbuild/repos/numbers/BuildsProd/Classes/Native/Generics1.cpp:50068
#79 0x0000000102497084 in Routine_1_Step_m4D02DF56C5C64B67BDB340FF34AFE9939ACF8FAA_gshared at /Users/ululabbuild/repos/numbers/BuildsProd/Classes/Native/Generics78.cpp:24435
#80 0x0000000101dccd1c in U3CU3Ec__DisplayClass42_0_1_U3CFlattenU3Eb__0_mECA1AA3D2AD308DD9DB6544FDCDAE81EC1155817_gshared at /Users/ululabbuild/repos/numbers/BuildsProd/Classes/Native/Generics2.cpp:16360
#81 0x0000000102497b6c in Routine_1_Step_mB89D02EB49527DE014D80E0D473477D15C91E867_gshared at /Users/ululabbuild/repos/numbers/BuildsProd/Classes/Native/Generics78.cpp:24832
#82 0x0000000101c63a94 in U3CU3Ec__DisplayClass40_0_2_U3CMapU3Eb__0_m44BE290DF4538D224DD884C945836E26AD0DDE11_gshared at /Users/ululabbuild/repos/numbers/BuildsProd/Classes/Native/Generics1.cpp:50132
#83 0x0000000102497b6c in Routine_1_Step_mB89D02EB49527DE014D80E0D473477D15C91E867_gshared at /Users/ululabbuild/repos/numbers/BuildsProd/Classes/Native/Generics78.cpp:24832
#84 0x0000000101a7cee4 in Option_Bind_TisRuntimeObject_TisUnit_t135B1E794A325E2D5D5BE5F538101F2019378104_m68D157233FCBFF940BE1D7526CB8AEF6CE315B00_gshared at /Users/ululabbuild/repos/numbers/BuildsProd/Classes/Native/GenericMethods18.cpp:17313
#85 0x0000000101dcce50 in U3CU3Ec__DisplayClass42_0_1_U3CFlattenU3Eb__0_mECA1AA3D2AD308DD9DB6544FDCDAE81EC1155817_gshared at /Users/ululabbuild/repos/numbers/BuildsProd/Classes/Native/Generics2.cpp:16390
#86 0x0000000102497b6c in Routine_1_Step_mB89D02EB49527DE014D80E0D473477D15C91E867_gshared at /Users/ululabbuild/repos/numbers/BuildsProd/Classes/Native/Generics78.cpp:24832
#87 0x00000001024977e4 in Routine_1_get_keepWaiting_m808D6FC5BDA2991261DFFCF341EDF29FB659576D_gshared at /Users/ululabbuild/repos/numbers/BuildsProd/Classes/Native/Generics78.cpp:24702
#88 0x0000000102d476d4 in InterfaceFuncInvoker0<bool>::Invoke(unsigned short, Il2CppClass*, Il2CppObject*) at /Users/ululabbuild/repos/numbers/BuildsProd/Classes/Native/UnityEngine.CoreModule1.cpp:119
#89 0x0000000102d476d4 in SetupCoroutine_InvokeMoveNext_m72FC77384CAC3133B6EE650E0581D055B34B2F5F at /Users/ululabbuild/repos/numbers/BuildsProd/Classes/Native/UnityEngine.CoreModule1.cpp:24267
#90 0x00000001014c73dc in il2cpp::vm::Runtime::InvokeWithThrow(MethodInfo const*, void*, void**) ()
#91 0x00000001014c723c in il2cpp::vm::Runtime::Invoke(MethodInfo const*, void*, void**, Il2CppException**) ()
#92 0x0000000100c18ae8 in scripting_method_invoke(ScriptingMethodPtr, ScriptingObjectPtr, ScriptingArguments&, ScriptingExceptionPtr*, bool) ()
#93 0x0000000100c248dc in ScriptingInvocation::Invoke(ScriptingExceptionPtr*, bool) ()
#94 0x0000000100c32204 in Invoke ()
#95 0x0000000100c32204 in Coroutine::InvokeMoveNext(ScriptingExceptionPtr*) ()
#96 0x0000000100c31db8 in Coroutine::Run(bool*) ()
#97 0x0000000100c33ff8 in MonoBehaviour::TryCreateAndRunCoroutine(ScriptingObjectPtr, ScriptingMethodPtr, Coroutine**) ()
#98 0x0000000100c34458 in CreateCoroutine ()
#99 0x0000000100c34458 in MonoBehaviour::StartCoroutineManaged2(ScriptingObjectPtr) ()
#100 0x0000000100a04e0c in MonoBehaviour_CUSTOM_StartCoroutineManaged2(ScriptingBackendNativeObjectPtrOpaque*, ScriptingBackendNativeObjectPtrOpaque*) ()
#101 0x00000001014c73dc in il2cpp::vm::Runtime::InvokeWithThrow(MethodInfo const*, void*, void**) ()
#102 0x00000001014c723c in il2cpp::vm::Runtime::Invoke(MethodInfo const*, void*, void**, Il2CppException**) ()
#103 0x0000000100c18ae8 in scripting_method_invoke(ScriptingMethodPtr, ScriptingObjectPtr, ScriptingArguments&, ScriptingExceptionPtr*, bool) ()
#104 0x0000000100c248dc in ScriptingInvocation::Invoke(ScriptingExceptionPtr*, bool) ()
#105 (null) in MonoBehaviour::InvokeMethodOrCoroutineChecked(ScriptingMethodPtr, ScriptingObjectPtr, ScriptingExceptionPtr*) ()
#106 0x0000000100c34f18 in MonoBehaviour::InvokeMethodOrCoroutineChecked(ScriptingMethodPtr, ScriptingObjectPtr) ()
#107 0x0000000100c3579c in Start ()
#108 0x0000000100c3579c in MonoBehaviour::DelayedStartCall(Object*, void*) ()
#109 0x0000000100aad2cc in DelayedCallManager::Update(int) ()
#110 0x0000000100b5e088 in ExecutePlayerLoop(NativePlayerLoopSystem*) ()
#111 0x0000000100b5e0c8 in ExecutePlayerLoop(NativePlayerLoopSystem*) ()
#112 0x0000000100b5e324 in PlayerLoop() ()
#113 0x000000010116a310 in UnityPlayerLoopImpl(bool) ()
#114 0x00000001004ce7b4 in UnityRepaint at /Users/ululabbuild/repos/numbers/BuildsProd/Classes/UnityAppController+Rendering.mm:236
#115 0x00000001004ce7b4 in -[UnityAppController(Rendering) repaint] at /Users/ululabbuild/repos/numbers/BuildsProd/Classes/UnityAppController+Rendering.mm:90
#116 0x00000001004ce744 in -[UnityAppController(Rendering) repaintDisplayLink] at /Users/ululabbuild/repos/numbers/BuildsProd/Classes/UnityAppController+Rendering.mm:71
#117 (null) in CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) ()
#118 (null) in IODispatchCalloutFromCFMessage ()
#119 (null) in __CFMachPortPerform ()
#120 (null) in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ ()
#121 (null) in __CFRunLoopDoSource1 ()
#122 (null) in __CFRunLoopRun ()
#123 (null) in CFRunLoopRunSpecific ()
#124 (null) in GSEventRunModal ()
#125 (null) in UIApplicationMain ()
#126 0x00000001004cdfb4 in -[UnityFramework runUIApplicationMainWithArgc:argv:] at /Users/ululabbuild/repos/numbers/BuildsProd/MainApp/main.mm:96
#127 0x000000010027eb04 in main at /Users/ululabbuild/repos/numbers/BuildsProd/MainApp/main.mm:26
#128 (null) in start ()

If using Swift Package Manager, the project's Package.resolved

Expand Package.resolved snippet
```json Replace this line with the contents of your Package.resolved. ```

If using CocoaPods, the project's Podfile.lock

Expand Podfile.lock snippet
```yml Replace this line with the contents of your Podfile.lock! ```
google-oss-bot commented 1 year ago

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

rizafran commented 1 year ago

Hi @UlulabDev, it seems that your issue is related to Firebase Unity SDK. With this, please file a ticket to Unity repo. I'll now be closing this.

ncooke3 commented 1 year ago

Hi @UlulabDev, sorry for the churn, but I'm re-opening to investigate.

ncooke3 commented 1 year ago

Are there any other stack traces that can be shared? A full crash log would be helpful.

UlulabDev commented 1 year ago

No problem at all - I've also opened this one BTW: https://github.com/firebase/firebase-unity-sdk/issues/820

I'm not super familiar with sharing crash details on iOS. I can see a .xccrashpoint - would that help? Let me know how I could send you this privately if that's the case.

We also got this second seemingly related crash , albeit less frequent (~5% compared to the one above):

#0 (null) in __abort_with_payload ()
#1 (null) in abort_with_payload_wrapper_internal ()
#2 (null) in abort_with_payload ()
#3 (null) in dyld::halt(char const*) ()
#4 (null) in dyld::fastBindLazySymbol(ImageLoader**, unsigned long) ()
#5 (null) in dyld_stub_binder ()
#6 (null) in type metadata completion function for SK2StoreProduct ()
#7 (null) in swift_getSingletonMetadata ()
#8 (null) in type metadata accessor for SK2StoreProduct ()
#9 (null) in swift_conformsToSwiftProtocolImpl(swift::TargetMetadata<swift::InProcess> const*, swift::TargetPr... ()
#10 (null) in swift_conformsToProtocol ()
#11 (null) in swift::_conformsToProtocol(swift::OpaqueValue const*, swift::TargetMetadata<swift::InProcess> con... ()
#12 (null) in swift::_checkGenericRequirements(llvm::ArrayRef<swift::TargetGenericRequirementDescriptor<swift::... ()
#13 (null) in (anonymous namespace)::DecodedMetadataBuilder::createBoundGenericType(swift::TargetContextDescrip... ()
#14 (null) in swift::Demangle::TypeDecoder<(anonymous namespace)::DecodedMetadataBuilder>::decodeMangledType(sw... ()
#15 (null) in swift::Demangle::TypeDecoder<(anonymous namespace)::DecodedMetadataBuilder>::decodeMangledType(sw... ()
#16 (null) in swift_getTypeByMangledNodeImpl(swift::MetadataRequest, swift::Demangle::Demangler&, swift::Demang... ()
#17 (null) in swift::swift_getTypeByMangledNode(swift::MetadataRequest, swift::Demangle::Demangler&, swift::Dem... ()
#18 (null) in swift_getTypeByMangledNameImpl(swift::MetadataRequest, llvm::StringRef, std::__1::function<swift:... ()
#19 (null) in swift::swift_getTypeByMangledName(swift::MetadataRequest, llvm::StringRef, std::__1::function<swi... ()
#20 (null) in swift_getTypeByMangledNameInContext ()
#21 (null) in __swift_instantiateConcreteTypeFromMangledName ()
#22 (null) in 0x102800000 ()
#23 (null) in specialized _NativeDictionary.setValue(_:forKey:isUnique:) ()
#24 (null) in specialized Dictionary._Variant.setValue(_:forKey:) ()
#25 0x0000000102ae838c in 0x102800000 at /Users/ululabbuild/repos/numbers/BuildsProd/Pods/FirebaseCoreInternal/FirebaseCore/Internal/Sources/HeartbeatLogging/HeartbeatStorage.swift:64
#26 (null) in 0x102800000 ()
#27 0x0000000102ada7e4 in 0x102800000 ()
#28 0x0000000102ad6ed8 in -[FIRHeartbeatLogger initWithAppID:userAgentProvider:] at /Users/ululabbuild/repos/numbers/BuildsProd/Pods/FirebaseCore/FirebaseCore/Sources/FIRHeartbeatLogger.m:52
#29 0x0000000102ad6e2c in -[FIRHeartbeatLogger initWithAppID:] at /Users/ululabbuild/repos/numbers/BuildsProd/Pods/FirebaseCore/FirebaseCore/Sources/FIRHeartbeatLogger.m:44
#30 0x0000000102ad32a8 in -[FIRApp initInstanceWithName:options:] at /Users/ululabbuild/repos/numbers/BuildsProd/Pods/FirebaseCore/FirebaseCore/Sources/FIRApp.m:342
#31 0x0000000102ad29b8 in +[FIRApp configureWithName:options:] at /Users/ululabbuild/repos/numbers/BuildsProd/Pods/FirebaseCore/FirebaseCore/Sources/FIRApp.m:204
#32 0x0000000102ad26ac in +[FIRApp configureWithOptions:] at /Users/ululabbuild/repos/numbers/BuildsProd/Pods/FirebaseCore/FirebaseCore/Sources/FIRApp.m:146
#33 (null) in invocation function for block in firebase::(anonymous namespace)::CreatePlatformApp(firebase::AppOptions const&, char const*) ()
#34 (null) in firebase::(anonymous namespace)::CreatePlatformApp(firebase::AppOptions const&, char const*) ()
#35 (null) in firebase::(anonymous namespace)::CreateOrGetPlatformApp(firebase::AppOptions const&, char const*) ()
#36 (null) in firebase::App::Create(firebase::AppOptions const&, char const*) ()
#37 (null) in firebase::App::Create(firebase::AppOptions const&) ()
#38 (null) in firebase::App::Create() ()
#39 (null) in firebase::AppCreate(firebase::AppOptions const*, char const*) ()
#40 (null) in firebase::AppGetOrCreateInstance(firebase::AppOptions const*, char const*) ()
#41 (null) in firebase_App_CreateInternal__SWIG_0() ()
#42 (null) in Firebase_App_CSharp_FirebaseApp_CreateInternal__SWIG_0 ()
#43 0x0000000103c57148 in AppUtilPINVOKE_FirebaseApp_CreateInternal__SWIG_0_m8C61ECBE5407D4A591827E10595AE28EFE8C6CE5 at /Users/ululabbuild/repos/numbers/BuildsProd/Classes/Native/Firebase.App.cpp:30894
#44 0x0000000103c57148 in FirebaseApp_CreateInternal_m63EB3F64189DA8E6C5B2E1C95B11D63EF7F7BC4B at /Users/ululabbuild/repos/numbers/BuildsProd/Classes/Native/Firebase.App.cpp:22376
#45 0x0000000103c53348 in CreateDelegate_Invoke_m3C05F10053C0FD938376079571835049ADDD6186_inline(CreateDelegate_tC2B37930B020E09BB7E6EBC451C2864B0B29DE73*, MethodInfo const*) at /Users/ululabbuild/repos/numbers/BuildsProd/Classes/Native/Firebase.App.cpp:34738
#46 0x0000000103c53348 in FirebaseApp_CreateAndTrack_m3EFC2B1BFE4FF3BE069B04DE63E93A257CD65B3E at /Users/ululabbuild/repos/numbers/BuildsProd/Classes/Native/Firebase.App.cpp:20829
#47 0x0000000103c3b740 in FirebaseAnalytics__cctor_mC245C283209D04E164172DD540ACA071E394B5F0 at /Users/ululabbuild/repos/numbers/BuildsProd/Classes/Native/Firebase.Analytics.cpp:5814
#48 0x000000010380f3dc in il2cpp::vm::Runtime::InvokeWithThrow(MethodInfo const*, void*, void**) ()
#49 0x000000010380f23c in 0x102800000 ()
#50 0x000000010380d76c in il2cpp::vm::Runtime::ClassInit(Il2CppClass*) ()
#51 0x0000000103a090bc in il2cpp_codegen_runtime_class_init_inline(Il2CppClass*) ()
#52 0x0000000103a090bc in FirebaseManagerBhvr_Awake_m6030513E14DEEBF484F7BC0FF2F9D807C36D4203 at /Users/ululabbuild/repos/numbers/BuildsProd/Classes/Native/Assembly-CSharp1.cpp:17982
#53 0x000000010380f3dc in il2cpp::vm::Runtime::InvokeWithThrow(MethodInfo const*, void*, void**) ()
#54 0x000000010380f23c in 0x102800000 ()
#55 0x0000000102f60ae8 in scripting_method_invoke(ScriptingMethodPtr, ScriptingObjectPtr, ScriptingArguments&, ScriptingExceptionPtr*, bool) ()
#56 0x0000000102f6c8dc in ScriptingInvocation::Invoke(ScriptingExceptionPtr*, bool) ()
#57 0x0000000102f6f5d8 in Invoke ()
#58 0x0000000102f6f5d8 in ScriptingInvocation::InvokeChecked(ScriptingExceptionPtr*) ()
#59 0x0000000102fb1c48 in SerializableManagedRef::CallMethod(Object&, ScriptingMethodPtr) ()
#60 0x0000000102f7daec in CallMethodInactive ()
#61 0x0000000102f7daec in MonoBehaviour::CallAwake() ()
#62 0x0000000102f7df20 in 0x102800000 ()
#63 (null) in 0x102800000 ()
#64 0x0000000102fb3264 in AwakeFromLoadQueue::InvokeAwakeFromLoad(AwakeFromLoadQueue::Item*, unsigned int, AwakeFromLoadMode) ()
#65 0x0000000102fb312c in AwakeFromLoadQueue::AwakeFromLoadAllQueues(AwakeFromLoadMode, bool) ()
#66 0x0000000102ddd6c0 in AwakeFromLoad ()
#67 0x0000000102ddd6c0 in GameObject::ActivateAwakeRecursively(DeactivateOperation) ()
#68 0x0000000102d4abdc in GameObject_CUSTOM_SetActive(ScriptingBackendNativeObjectPtrOpaque*, unsigned char) ()
#69 0x0000000103bd8844 in GameLoaderBhvr_U3CGameLoaderRoutineU3Eb__6_12_mD2571AB5D64980EC6B23A5512C93FD0DEBAC614B at /Users/ululabbuild/repos/numbers/BuildsProd/Classes/Native/Assembly-CSharp6.cpp:34515
#70 0x0000000103de0754 in Option_Map_TisUnit_t135B1E794A325E2D5D5BE5F538101F2019378104_TisRuntimeObject_mBBE9EDCCB89FCB2531CDF4621175BBD4A9F5E0C9_gshared at /Users/ululabbuild/repos/numbers/BuildsProd/Classes/Native/GenericMethods18.cpp:36680
#71 0x0000000103fab9d4 in U3CU3Ec__DisplayClass40_0_2_U3CMapU3Eb__0_m9AB914918F77BF3D81042A15DC410D5D6DE2F20A_gshared at /Users/ululabbuild/repos/numbers/BuildsProd/Classes/Native/Generics1.cpp:50068
#72 0x00000001047df084 in Routine_1_Step_m4D02DF56C5C64B67BDB340FF34AFE9939ACF8FAA_gshared at /Users/ululabbuild/repos/numbers/BuildsProd/Classes/Native/Generics78.cpp:24435
#73 0x0000000104114d1c in U3CU3Ec__DisplayClass42_0_1_U3CFlattenU3Eb__0_mECA1AA3D2AD308DD9DB6544FDCDAE81EC1155817_gshared at /Users/ululabbuild/repos/numbers/BuildsProd/Classes/Native/Generics2.cpp:16360
#74 0x00000001047dfb6c in Routine_1_Step_mB89D02EB49527DE014D80E0D473477D15C91E867_gshared at /Users/ululabbuild/repos/numbers/BuildsProd/Classes/Native/Generics78.cpp:24832
#75 0x0000000103faba94 in 0x102800000 at /Users/ululabbuild/repos/numbers/BuildsProd/Classes/Native/Generics1.cpp:50132
#76 0x00000001047dfb6c in Routine_1_Step_mB89D02EB49527DE014D80E0D473477D15C91E867_gshared at /Users/ululabbuild/repos/numbers/BuildsProd/Classes/Native/Generics78.cpp:24832
#77 0x0000000103dc4ee4 in Option_Bind_TisRuntimeObject_TisUnit_t135B1E794A325E2D5D5BE5F538101F2019378104_m68D157233FCBFF940BE1D7526CB8AEF6CE315B00_gshared at /Users/ululabbuild/repos/numbers/BuildsProd/Classes/Native/GenericMethods18.cpp:17313
#78 0x0000000104114e50 in 0x102800000 at /Users/ululabbuild/repos/numbers/BuildsProd/Classes/Native/Generics2.cpp:16390
#79 0x00000001047dfb6c in Routine_1_Step_mB89D02EB49527DE014D80E0D473477D15C91E867_gshared at /Users/ululabbuild/repos/numbers/BuildsProd/Classes/Native/Generics78.cpp:24832
#80 0x00000001047df7e4 in Routine_1_get_keepWaiting_m808D6FC5BDA2991261DFFCF341EDF29FB659576D_gshared at /Users/ululabbuild/repos/numbers/BuildsProd/Classes/Native/Generics78.cpp:24702
#81 0x000000010508f6d4 in InterfaceFuncInvoker0<bool>::Invoke(unsigned short, Il2CppClass*, Il2CppObject*) at /Users/ululabbuild/repos/numbers/BuildsProd/Classes/Native/UnityEngine.CoreModule1.cpp:119
#82 0x000000010508f6d4 in SetupCoroutine_InvokeMoveNext_m72FC77384CAC3133B6EE650E0581D055B34B2F5F at /Users/ululabbuild/repos/numbers/BuildsProd/Classes/Native/UnityEngine.CoreModule1.cpp:24267
#83 0x000000010380f3dc in il2cpp::vm::Runtime::InvokeWithThrow(MethodInfo const*, void*, void**) ()
#84 0x000000010380f23c in 0x102800000 ()
#85 0x0000000102f60ae8 in scripting_method_invoke(ScriptingMethodPtr, ScriptingObjectPtr, ScriptingArguments&, ScriptingExceptionPtr*, bool) ()
#86 0x0000000102f6c8dc in ScriptingInvocation::Invoke(ScriptingExceptionPtr*, bool) ()
#87 0x0000000102f7a204 in Invoke ()
#88 0x0000000102f7a204 in Coroutine::InvokeMoveNext(ScriptingExceptionPtr*) ()
#89 0x0000000102f79db8 in Coroutine::Run(bool*) ()
#90 0x0000000102f7bff8 in MonoBehaviour::TryCreateAndRunCoroutine(ScriptingObjectPtr, ScriptingMethodPtr, Coroutine**) ()
#91 0x0000000102f7c458 in CreateCoroutine ()
#92 0x0000000102f7c458 in MonoBehaviour::StartCoroutineManaged2(ScriptingObjectPtr) ()
#93 0x0000000102d4ce0c in MonoBehaviour_CUSTOM_StartCoroutineManaged2(ScriptingBackendNativeObjectPtrOpaque*, ScriptingBackendNativeObjectPtrOpaque*) ()
#94 0x000000010380f3dc in il2cpp::vm::Runtime::InvokeWithThrow(MethodInfo const*, void*, void**) ()
#95 0x000000010380f23c in 0x102800000 ()
#96 0x0000000102f60ae8 in scripting_method_invoke(ScriptingMethodPtr, ScriptingObjectPtr, ScriptingArguments&, ScriptingExceptionPtr*, bool) ()
#97 0x0000000102f6c8dc in ScriptingInvocation::Invoke(ScriptingExceptionPtr*, bool) ()
#98 (null) in 0x102800000 ()
#99 0x0000000102f7cf18 in MonoBehaviour::InvokeMethodOrCoroutineChecked(ScriptingMethodPtr, ScriptingObjectPtr) ()
#100 (null) in 0x102800000 ()
#101 0x0000000102df52cc in 0x102800000 ()
#102 0x0000000102ea6088 in ExecutePlayerLoop(NativePlayerLoopSystem*) ()
#103 0x0000000102ea60c8 in 0x102800000 ()
#104 0x0000000102ea6324 in PlayerLoop() ()
#105 0x00000001034b2310 in UnityPlayerLoopImpl(bool) ()
#106 (null) in 0x102800000 ()
#107 0x0000000102816744 in -[UnityAppController(Rendering) repaintDisplayLink] at /Users/ululabbuild/repos/numbers/BuildsProd/Classes/UnityAppController+Rendering.mm:71
#108 (null) in CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) ()
#109 (null) in IODispatchCalloutFromCFMessage ()
#110 (null) in __CFMachPortPerform ()
#111 (null) in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ ()
#112 (null) in __CFRunLoopDoSource1 ()
#113 (null) in __CFRunLoopRun ()
#114 (null) in CFRunLoopRunSpecific ()
#115 (null) in GSEventRunModal ()
#116 (null) in UIApplicationMain ()
#117 0x0000000102815fb4 in -[UnityFramework runUIApplicationMainWithArgc:argv:] at /Users/ululabbuild/repos/numbers/BuildsProd/MainApp/[main.mm:96](http://main.mm:96/)
#118 0x00000001005a6b04 in main at /Users/ululabbuild/repos/numbers/BuildsProd/MainApp/[main.mm:26](http://main.mm:26/)
#119 (null) in start ()
ncooke3 commented 1 year ago

Thanks, the .xccrashpoint file should do. You can email it to me at nickcooke at google dot com

UlulabDev commented 1 year ago

Great - just emailed it to you. We'll certainly be interested to hear if you find a version that's the issue. For now our plan is to try to repro, and try reverting the change in version. But it's not clear that we can easily revert or that we'll be able to repro locally, so any indication of the real source of the issue will still be helpful in deciding what we do in the next few days.

ncooke3 commented 1 year ago

After reviewing the crash reports, I'm thinking this may be a bug in the Swift compiler. Are there any warnings when building?

ncooke3 commented 1 year ago

We'll certainly be interested to hear if you find a version that's the issue.

In terms of versioning, the code that triggers the crash was introduced in Firebase 9.0.0.

ncooke3 commented 1 year ago

This looks similar to https://github.com/RevenueCat/purchases-unity/issues/278, so I'm thinking a fix similar to what was done there may work.

UlulabDev commented 1 year ago

I'm not seeing any relevant warnings between the build with the issue, and the previous one without. Just in case:

[2023-05-14T22:56:27Z - Unity] Installing for iOS. Setting ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES to NO and adding StoreKit [2023-05-14T22:56:27Z - Unity] UnityEngine.StackTraceUtility:ExtractStackTrace () (at /Users/bokken/build/output/unity/unity/Runtime/Export/Scripting/StackTrace.cs:37) [2023-05-14T22:56:27Z - Unity] UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[]) [2023-05-14T22:56:27Z - Unity] UnityEngine.Logger:Log (UnityEngine.LogType,object) [2023-05-14T22:56:27Z - Unity] UnityEngine.Debug:Log (object) [2023-05-14T22:56:27Z - Unity] XcodeSwiftVersionPostProcess:OnPostProcessBuild (UnityEditor.BuildTarget,string) (at Assets/RevenueCat/Editor/RevenueCatPostInstall.cs:18) [2023-05-14T22:56:27Z - Unity] System.Reflection.RuntimeMethodInfo:Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) [2023-05-14T22:56:27Z - Unity] System.Reflection.MethodBase:Invoke (object,object[]) [2023-05-14T22:56:27Z - Unity] UnityEditor.Build.BuildPipelineInterfaces/AttributeCallbackWrapper:OnPostprocessBuild (UnityEditor.Build.Reporting.BuildReport) (at /Users/bokken/build/output/unity/unity/Editor/Mono/BuildPipeline/BuildPipelineInterfaces.cs:186) [2023-05-14T22:56:27Z - Unity] UnityEditor.Build.BuildPipelineInterfaces/<>c__DisplayClass18_0:b__1 (UnityEditor.Build.IPostprocessBuildWithReport) (at /Users/bokken/build/output/unity/unity/Editor/Mono/BuildPipeline/BuildPipelineInterfaces.cs:458) [2023-05-14T22:56:27Z - Unity] UnityEditor.Build.BuildPipelineInterfaces:InvokeCallbackInterfacesPair<UnityEditor.Build.IPostprocessBuild, UnityEditor.Build.IPostprocessBuildWithReport> (System.Collections.Generic.List1<UnityEditor.Build.IPostprocessBuild>,System.Action1,System.Collections.Generic.List1<UnityEditor.Build.IPostprocessBuildWithReport>,System.Action1,bool) (at /Users/bokken/build/output/unity/unity/Editor/Mono/BuildPipeline/BuildPipelineInterfaces.cs:402) [2023-05-14T22:56:27Z - Unity] UnityEditor.Build.BuildPipelineInterfaces:OnBuildPostProcess (UnityEditor.Build.Reporting.BuildReport) (at /Users/bokken/build/output/unity/unity/Editor/Mono/BuildPipeline/BuildPipelineInterfaces.cs:456) [2023-05-14T22:56:27Z - Unity] UnityEditor.BuildPipeline:BuildPlayerInternal (string[],string,string,UnityEditor.BuildTargetGroup,UnityEditor.BuildTarget,int,UnityEditor.BuildOptions,string[]) (at /Users/bokken/build/output/unity/unity/Editor/Mono/BuildPipeline.bindings.cs:449) [2023-05-14T22:56:27Z - Unity] UnityEditor.BuildPipeline:BuildPlayer (string[],string,string,UnityEditor.BuildTargetGroup,UnityEditor.BuildTarget,int,UnityEditor.BuildOptions,string[]) (at /Users/bokken/build/output/unity/unity/Editor/Mono/BuildPipeline.bindings.cs:348) [2023-05-14T22:56:27Z - Unity] UnityEditor.BuildPipeline:BuildPlayer (UnityEditor.BuildPlayerOptions) (at /Users/bokken/build/output/unity/unity/Editor/Mono/BuildPipeline.bindings.cs:322) [2023-05-14T22:56:27Z - Unity] UnityEditor.BuildPipeline:BuildPlayer (string[],string,UnityEditor.BuildTarget,UnityEditor.BuildOptions) (at /Users/bokken/build/output/unity/unity/Editor/Mono/BuildPipeline.bindings.cs:317) [2023-05-14T22:56:27Z - Unity] UnityEditor.CloudBuild.Builder:BuildPlayerDefault (UnityEditor.BuildPlayerOptions) [2023-05-14T22:56:27Z - Unity] UnityEditor.CloudBuild.Builder:BuildPlayer (UnityEditor.BuildPlayerOptions) [2023-05-14T22:56:27Z - Unity] UnityEditor.CloudBuild.Builder:Build () [2023-05-14T22:56:27Z - Unity] (Filename: Assets/RevenueCat/Editor/RevenueCatPostInstall.cs Line: 18)

UlulabDev commented 1 year ago

We'll certainly be interested to hear if you find a version that's the issue.

In terms of versioning, the code that triggers the crash was introduced in Firebase 9.0.0.

Weird - we didn't change Firebase version and were on 9.1.0 in both the non crashing and the crashing version. The only thing that was updated besides RevenueCat was the ExternalDependencyManager from version 1.2.175 to version 1.2.176. Maybe some iOS libraries were updated as part of that, and the firebase crash is only triggered in that specific version?

We're struggling to find compatible versions of RevenueCat and Firebase that don't cause issues for a significant % of our user base. So it'd be pretty important for us to understand which specific version / library caused the crash. Please let us know if you have insights there.

FYI we weren't able to get a reproing device yesterday (can't downgrade the iOS to 12), so I can't 100% confirm that reverting the RC / Firebase update will work until we release, hopefully next week.

ncooke3 commented 1 year ago

We're struggling to find compatible versions of RevenueCat and Firebase that don't cause issues for a significant % of our user base.

I'm curious how this incompatibility is surfacing to customers? I'm not aware of any RevenueCat x Firebase issues, so I'd like to know more about this point.


This warning was present in the crashing version, but not in the previous non-crashing one:

Hmm, I'm not too sure about how/if these warnings could contribute to the issue.

it looks like we've got two libraries trying to set the same thing. This is in the same order for both builds, so I doubt it's the issue here:

Depending on your project's minimum deployment target, bumping it to 12.2+ may resolve the issue as that is when Swift started shipping with the OS. If reasonable, this may be worth testing when/if you're able to reproduce the issue. I'm still looking into what possible ways Firebase's code can change here.

UlulabDev commented 1 year ago

We're struggling to find compatible versions of RevenueCat and Firebase that don't cause issues for a significant % of our user base.

I'm curious how this incompatibility is surfacing to customers? I'm not aware of any RevenueCat x Firebase issues, so I'd like to know more about this point.

Certainly - I'll post back on that next week

This warning was present in the crashing version, but not in the previous non-crashing one:

Hmm, I'm not too sure about how/if these warnings could contribute to the issue.

Agreed, just noting a difference in case

it looks like we've got two libraries trying to set the same thing. This is in the same order for both builds, so I doubt it's the issue here:

Depending on your project's minimum deployment target, bumping it to 12.2+ may resolve the issue as that is when Swift started shipping with the OS. If reasonable, this may be worth testing when/if you're able to reproduce the issue. I'm still looking into what possible ways Firebase's code can change here.

We could try this, but good to know that the crash reports from Apple show this issues is occurring at every minor version of iOS 12, up to 12.5 (and just noticed, possibly iOS 13.3 as well, but it's not possible to tell if it's the exact same crash). So it seems to me like that wouldn't fix it.

paulb777 commented 6 months ago

Is this still an issue?

UlulabDev commented 6 months ago

We actually had uninstalled Firebase due to this crash and overall maintenance needs, for the relatively low use we had for firebase. We now have an actual use case for it, so we're re-integrating it. We assume the crash might still be present, and our plan at the moment is to add the remote option to not initialize the plugin on iOS 12. I can post back here if we notice the crashes coming back, as we'll be testing the latest version of firebase.

google-oss-bot commented 5 months ago

Hey @UlulabDev. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

google-oss-bot commented 5 months ago

Since there haven't been any recent updates here, I am going to close this issue.

@UlulabDev if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.