Crashed at FIRComponentContainer on 6.7.0
[REQUIRED] Step 2: Describe your environment
- Firebase SDK version: 6.7.0
- Firebase Component: Below is from my
Podfile.
pod 'Firebase/Core', '~> 6.0'
pod 'Firebase/AdMob'
pod 'Firebase/Auth'
pod 'Google-Mobile-Ads-SDK'
pod 'Firebase/Messaging'
pod 'Firebase/Functions'
pod 'Firebase/RemoteConfig'
pod 'Firebase/Performance'
[REQUIRED] Step 3: Describe the problem
Steps to reproduce:
Not sure how to reproduce so far, I just found some users of my app got this crash due to this issue. Seems it accesses non-existent key against cached instances. https://github.com/firebase/firebase-ios-sdk/blob/bb563c8497c0a8fb4d237604062535701dd7ba25/Firebase/Core/FIRComponentContainer.m#L150
Crashed: com.google.perf.FPREventsQueue
0 libobjc.A.dylib 0x223548d68 objc_msgSend + 8
1 CoreFoundation 0x22424bb60 -[__NSDictionaryM objectForKeyedSubscript:] + 212
2 MyApp 0x104e26d78 -[FIRComponentContainer instanceForProtocol:] + 150 (FIRComponentContainer.m:150)
3 MyApp 0x104e2710c +[FIRComponentType instanceForProtocol:inContainer:] + 25 (FIRComponentType.m:25)
4 MyApp 0x104ef7eac -[FIRRemoteConfigComponent remoteConfigForNamespace:] + 4380917420
5 MyApp 0x104ef4438 +[FIRRemoteConfig remoteConfigWithFIRNamespace:app:] + 4380902456
6 MyApp 0x104e714c0 __38+[FPRRemoteConfigFlags sharedInstance]_block_invoke + 4380366016
7 ??? 0x223d9a484 (Missing)
8 ??? 0x223d6a234 (Missing)
9 MyApp 0x104e71468 +[FPRRemoteConfigFlags sharedInstance] + 4380365928
10 MyApp 0x104e702cc -[FPRConfigurations setupRemoteConfigFlags] + 4380361420
11 MyApp 0x104e7020c -[FPRConfigurations update] + 4380361228
12 MyApp 0x104e73500 __42-[FPRClient startWithConfiguration:error:]_block_invoke + 4380374272
(snip)
I'd like to help as much as possible if needed. Thanks!
I found a few problems with this issue:
- I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
- This issue does not seem to follow the issue template. Make sure you provide all the required information.
Hi @pot8os thanks for the report, and sorry you're seeing these crashes.
Some other information that would be very helpful:
- How many users (approximate number) are seeing this? Single digits, tens, hundreds, thousands, more?
- Is there any particular device that is crashing?
- Which iOS versions are affected?
Thanks, we're looking into this now and will keep you in the loop with how things are going. I'm not sure off the top of my head why this particular line of code would be crashing, is there a larger stack trace you could share?
Thanks for your quick response @ryanwilson !
- How many users (approximate number) are seeing this? Single digits, tens, hundreds, thousands, more?
It's not many right now. My app has apx 100,000 active users per week, and I see just 8 crashes due to this.
- Is there any particular device that is crashing?
- Which iOS versions are affected?
Seems there is no bias. It happened on iPhoneX, 8 and 7 with iOS 12 and 11.
is there a larger stack trace you could share?
The reason why I snipped some was all of the lines had (Missing) so no values. I could give a permanent link for Firebase Crashlytics of my app if you could accept DM.

We see the same crash in a "phased app release" that we just started yesterday (where one of the changes were upgrading to Firebase 6.7.0) It's still early numbers as not that many users has installed the new app yet, but it seems pretty serious with the 1,37% of users being impacted at this moment.

update
We have paused the phased rollout, as the numbers keep climbing. (But I haven't been able to actually reproduce it, so I cannot pitch in with any steps on how to reproduce it.)

We have the same problem. This crash affect 390 users in last 3 days after submit a new release.

Same here.
43 occurrences:

5 occurrences:

I'm having the same problem. It has been affected 1400 users in 3 days.
Falha: com.google.perf.FPREventsQueue EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000010 -[FIRComponentContainer instanceForProtocol:]
0 libobjc.A.dylib objc_msgSend + 16 1 CoreFoundation -[__NSDictionaryM objectForKeyedSubscript:] + 216 2 MobileApp FIRComponentContainer.m - Linha 150 -[FIRComponentContainer instanceForProtocol:] + 150 3 MobileApp FIRComponentType.m - Linha 25 +[FIRComponentType instanceForProtocol:inContainer:] + 25 4 MobileApp FIRExperimentController.m - Linha 173 +[FIRExperimentController sharedInstance] + 173 5 MobileApp -[FIRRemoteConfig initWithAppName:FIROptions:namespace:DBManager:configContent:analytics:] + 4349424704 6 MobileApp -[FIRRemoteConfigComponent remoteConfigForNamespace:] + 4349439160 7 MobileApp +[FIRRemoteConfig remoteConfigWithFIRNamespace:app:] + 4349423896 8 MobileApp __38+[FPRRemoteConfigFlags sharedInstance]_block_invoke + 4348886304 9 libdispatch.dylib _dispatch_client_callout + 16 10 libdispatch.dylib _dispatch_once_callout + 28 11 MobileApp +[FPRRemoteConfigFlags sharedInstance] + 4348886216 12 MobileApp -[FPRConfigurations setupRemoteConfigFlags] + 4348881708 13 MobileApp -[FPRConfigurations update] + 4348881516 14 MobileApp __42-[FPRClient startWithConfiguration:error:]_block_invoke + 4348894564 15 libdispatch.dylib _dispatch_call_block_and_release + 24 21 libsystem_pthread.dylib start_wqthread + 4
============================================================
Falha: com.apple.main-thread
SIGABRT ABORT 0x000000018bf970dc
0
libsystem_kernel.dylib
__pthread_kill + 8
7
CoreFoundation
-[__NSDictionaryM setObject:forKeyedSubscript:] + 428
8
MobileApp
FIRComponentContainer.m - Linha 139
-[FIRComponentContainer instantiateInstanceForProtocol:withBlock:] + 139
9
MobileApp
FIRComponentContainer.m - Linha 157
-[FIRComponentContainer instanceForProtocol:] + 157
10
MobileApp
FIRComponentType.m - Linha 25
+[FIRComponentType instanceForProtocol:inContainer:] + 25
11
MobileApp
FIRExperimentController.m - Linha 173
+[FIRExperimentController sharedInstance] + 173
12
MobileApp
-[FIRRemoteConfig initWithAppName:FIROptions:namespace:DBManager:configContent:analytics:] + 4302648384
13
MobileApp
-[FIRRemoteConfigComponent remoteConfigForNamespace:] + 4302662840
14
MobileApp
+[FIRRemoteConfig remoteConfigWithFIRNamespace:app:] + 4302647576
15
MobileApp
+[FIRRemoteConfig remoteConfig] + 4302647768
16
MobileApp
WMFirebaseManager.swift - Linha 120
specialized static WMFirebaseManager.start() + 120
17
MobileApp
AppDelegate.swift - Linha 94
AppDelegate.application(:didFinishLaunchingWithOptions:) + 94
18
MobileApp
Thanks everyone for the feedback and sorry for the troubles. It looks like a multithreading issue between Perf and Remote Config - we'll need to make sure the FIRComponentContainer has proper guards around the internal data structure.
In the meantime, if anybody manages to reproduce this it'll greatly help verifying a solution. This is top priority for us and we hope to have a proposed fix in the next day or so for folks to test.
@ryanwilson I guess the two different crashes are very close related? (The one on line 139 and the other on line 150)
We see that the one one line 139 happens 3 times as frequently as the other. And the one on line 150 only happens for iOS 12 users, where as the other one happens for iOS 10,11,12 and 13. Of course that can also explain the factor between the two frequencies.
Here are some more details for the one happening on line 150 (in case it can be of any help) dk.dba.app_issue_crash_611e44e8de6645a5a92c33934cedc5d1_DNE_0_v2.txt
I've received the same crash report FIRComponentContainer.m line 150 -[FIRComponentContainer instanceForProtocol:]
@pradipaub36 which version of Firebase are you using? Can you please check if you are on the latest version (6.8.1)?
No, I haven't checked with the latest SDK v6.8.1
I'll let you know if I face the same issue in the latest SDK.
Q. would it be stable version now?
Please re-open if you run into the same issue on the latest SDK, it should have been fixed in #3766.
I'm not sure what you mean about "would it be stable version now"? Core and any SDKs that don't begin with major version 0 (e.x. MLKit is at 0.18.0) should all be stable.
@ryanwilson we have released an app today with V6.8.1, and after the first 10K sessions, we have not seen a firebase related crash. We had plenty of crashes after 10K sessions in the app that was released with V6.7.0 SDK, so I think it's fair to say the problem is solved 👍 😄
@nfrydenholm Thank you so much for your support, I guess we may good to go with the updated SDKs and it may resolve all crashes that we faced from Firebase SDK.
I released a new version that implements 6.8.1 recently and seems this issue has gone! Thanks 😄