firebase-ios-sdk: [RemoteConfig] Crash if initializing after app start

[REQUIRED] Step 2: Describe your environment

  • Xcode version: 10.2.1
  • Firebase SDK version: 6.4.0
  • Firebase Component: RemoteConfig
  • Component version: 4.2.0

[REQUIRED] Step 3: Describe the problem

Stack trace:

EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000fca8c6b30
-[RCNConfigExperiment initWithDBManager:]

Crashed: com.apple.main-thread
0  libobjc.A.dylib                0x180d87530 objc_msgSend + 16
1  Runner                         0x10284c130 -[RCNConfigExperiment initWithDBManager:] + 4376871216
2  Runner                         0x102841920 -[FIRRemoteConfig initWithAppName:FIROptions:namespace:DBManager:configContent:] + 4376828192
3  Runner                         0x1028450e8 -[FIRRemoteConfigComponent remoteConfigForNamespace:] + 4376842472
4  Runner                         0x102841660 +[FIRRemoteConfig remoteConfigWithFIRNamespace:app:] + 4376827488
5  Runner                         0x102841720 +[FIRRemoteConfig remoteConfig] + 4376827680
6  Runner                         0x102905bec -[FirebaseRemoteConfigPlugin handleMethodCall:result:] + 39 (FirebaseRemoteConfigPlugin.m:39)
7  Flutter                        0x102f55ba8 (Missing)
8  Flutter                        0x102ef96a4 (Missing)
9  Flutter                        0x102f48ad0 (Missing)
10 Flutter                        0x102f04534 (Missing)
11 Flutter                        0x102f07cc8 (Missing)
12 CoreFoundation                 0x181b27650 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 28
13 CoreFoundation                 0x181b27380 __CFRunLoopDoTimer + 864
14 CoreFoundation                 0x181b26bb4 __CFRunLoopDoTimers + 248
15 CoreFoundation                 0x181b21b04 __CFRunLoopRun + 1844
16 CoreFoundation                 0x181b210b0 CFRunLoopRunSpecific + 436
17 GraphicsServices               0x183d2179c GSEventRunModal + 104
18 UIKitCore                      0x1ae38d978 UIApplicationMain + 212
19 Runner                         0x102601d48 main + 5 (AppDelegate.swift:5)
20 libdyld.dylib                  0x1815e68e0 start + 4

Steps to reproduce:

After upgrading Firebase dependencies from 6.3.0 to 6.4.0 and RemoteConfig from 4.1.0 to 4.2.0 we are getting crashes directly on app start. If the crash happen the next app starts are working. After some time (~1 hour) the crash happen again. We are using Firebase in a Flutter project.

Relevant Code:

Entry point: https://github.com/flutter/plugins/blob/master/packages/firebase_remote_config/ios/Classes/FirebaseRemoteConfigPlugin.m#L39

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 1
  • Comments: 35 (15 by maintainers)

Most upvoted comments

@paulb777 I can confirm the fix. Thanks for your quick help!

Firebase 6.5.0 just released with a fix. We were never able to reproduce the issue internally so would appreciate confirmation from those who saw the issue.

Same crash happening on Firebase (6.7.0) and FirebaseCore (6.2.1).

@dmandar yes, I also use FirePerf. I’ve posted my Podfile.lock above.

Based on all your input, we have made a fix for a race that occurs if Perf and RC SDK are both included, which should be out soon. @igiazlas can you also confirm you are also using FirePerf? If not, please confirm if you have the same stack trace.

I can reproduce it on an iPhone X running 12.3.1, on a 5s running 12.4 beta but not on a 6s running 11.4.1 (see edit). Also in all the 12.3.1 simulators I checked. It is consistent if I leave the last 3 lines in AppDelegate. If I remove them, and don’t put them anywhere else, it does not crash, at least not for the first 20-30 seconds that I let it run.

Edit: Before your last comment I downgraded to 6.3.0 and run the app on my devices with no problems. I upgraded again to make recheck the 11.4.1 6s and it didn’t crash. The weird thing is that after I build for the other devices they also do not crash anymore. When I delete the app and rebuild it it starts crashing again. So on some old installs it does not crash but it does crash consistently on fresh installs (Delete, Build, Install) on all devices, including the 6s with 11.4.1.

Edit 2: I have about 50 keys on my default configuration about 70 in total, including many that I do not use as they are used by the Android app

Edit 3: It is not that consistent after all. In some cases, removing and reinstalling the app does not cause a crash.