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

Crash on -[FPRRemoteConfigFlags cachedValueForConfigFlag:]

Open dongshuju opened this issue 7 years ago • 14 comments

[READ] Step 1: Are you in the right place?

Crash

[REQUIRED] Step 2: Describe your environment

  • Xcode version: Xcode 11.2.1
  • Firebase SDK version: 6.13.0
  • Firebase Component: Core
  • Component version: 6.13.0

[REQUIRED] Step 3: Describe the problem

We upgrade to lateast SDK version 6.13.0, Crashed on [FPRRemoteConfigFlags cachedValueForConfigFlag:]

Steps to reproduce:

It's crashed on com.hackemist.SDWebImageDownloader thread, but we do not use SDWebImage with FireBase.

Here is the Crash Info:

#0Crashed: com.hackemist.SDWebImageDownloader (QOS: UNSPECIFIED)EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000d80f10780 Raw Text
--
0 | libobjc.A.dylib | objc_msgSend + 16
1 | ** | -[FPRRemoteConfigFlags cachedValueForConfigFlag:] + 4377850916
2 | ** | -[FPRRemoteConfigFlags getStringValueForFlag:defaultValue:] + 4377851512
3 | ** | -[FPRRemoteConfigFlags sdkDisabledVersionsWithDefaultValue:] + 4377852196
4 | ** | -[FPRConfigurations sdkDisabledVersions] + 4377844816
5 | ** | -[FPRConfigurations sdkEnabled] + 4377844576
6 | ** | -[FPRNetworkTrace initWithURLRequest:] + 4377893596
7 | ** | __InstrumentDataTaskWithRequestCompletionHandler_block_invoke + 4377925080
8 | SDWebImage | SDWebImageDownloaderOperation.m line 162-[SDWebImageDownloaderOperation start] + 162
9 | Foundation | __NSOQSchedule_f + 276
17 | libsystem_pthread.dylib | start_wqthread + 4

dongshuju avatar Nov 26 '19 06:11 dongshuju

@dongshuju Thanks for the report. The reason why you are seeing SDWebImage as a part of the request is because Firebase Performance tries to measure the performance of all the network requests that happen.

With regards to the crash, we will take a look at it and rollout a fix for this very soon.

Are there any specific pattern you see in the crashes? (Eg. OS Version, Application state)

visumickey avatar Nov 26 '19 17:11 visumickey

@dongshuju In order to capture performance information of the network requests Firebase Performance needs to swizzle some object (e.g. NSURLSession). In your case the crash happens while a NSURLRequest created by SDWebImageDownloader is instrumented.

As a workaround you may temporary disable features of Firebase Performance requiring swizzling while investigating and fixing the issue by setting Performance.isInstrumentationEnabled to false before calling FirebaseApp.configure():

Performance. sharedInstance().isInstrumentationEnabled = false
FirebaseApp.configure()

maksymmalyhin avatar Nov 26 '19 17:11 maksymmalyhin

Hey @dongshuju. We need more information to resolve this issue but there hasn't been an update in 7 days. I'm marking the issue as stale and if there are no new updates in the next 3 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 avatar Dec 05 '19 02:12 google-oss-bot

@dongshuju Can you share the complete stack trace for this crash? I'm guessing a possible race condition triggering this issue and I would like to make sure we have other parts of the stack trace available for us to ascertain and look at this issue.

visumickey avatar Dec 06 '19 18:12 visumickey

Hey @dongshuju. We need more information to resolve this issue but there hasn't been an update in 7 days. I'm marking the issue as stale and if there are no new updates in the next 3 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 avatar Dec 14 '19 02:12 google-oss-bot

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

@dongshuju 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.

google-oss-bot avatar Dec 18 '19 02:12 google-oss-bot

@visumickey recently we included this SDK in-app and getting the same crash. Here some more information

Crashed: com.google.perf.FPREventsQueue
0  libobjc.A.dylib                0x1e7422f70 objc_msgSend + 16
1  Namshi                         0x101174238 -[FPRRemoteConfigFlags cachedValueForConfigFlag:] + 4369203768
2  Namshi                         0x10117448c -[FPRRemoteConfigFlags getStringValueForFlag:defaultValue:] + 4369204364
3  Namshi                         0x101174738 -[FPRRemoteConfigFlags sdkDisabledVersionsWithDefaultValue:] + 4369205048
4  Namshi                         0x101172a64 -[FPRConfigurations sdkDisabledVersions] + 4369197668
5  Namshi                         0x101172974 -[FPRConfigurations sdkEnabled] + 4369197428
6  Namshi                         0x101177130 -[FPRClient processAndLogEvent:] + 4369215792
7  Namshi                         0x101176a34 __22-[FPRClient logTrace:]_block_invoke + 4369214004
8  libdispatch.dylib              0x1e7c13b9c _dispatch_call_block_and_release + 32
9  libdispatch.dylib              0x1e7c15134 _dispatch_client_callout + 20
10 libdispatch.dylib              0x1e7c1c78c _dispatch_lane_serial_drain + 872
11 libdispatch.dylib              0x1e7c1d194 _dispatch_lane_invoke + 368
12 libdispatch.dylib              0x1e7c25480 _dispatch_workloop_worker_thread + 588
13 libsystem_pthread.dylib        0x1e7e16b20 _pthread_wqthread + 316
14 libsystem_pthread.dylib        0x1e7e1cdd4 start_wqthread + 4
Xcode version: Xcode 11.2.1
Firebase SDK version: 6.13.0
Firebase Component: Core
Component version: 6.13.0
iOS 11.0.1
iOS 12.x

BaluNaik avatar Jan 06 '20 14:01 BaluNaik

@visumickey I getting the same crash. Here some more information

Crashed: com.google.perf.FPREventsQueue
0 libobjc.A.dylib objc_object::release() + 16
1 MyApp -[FPRRemoteConfigFlags cachedValueForConfigFlag:] + 4376156408
2 MyApp -[FPRRemoteConfigFlags getBoolValueForFlag:defaultValue:] + 4376157316
3 MyApp -[FPRConfigurations sdkEnabled] + 4376149432
4 MyApp -[FPRClient processAndLogEvent:] + 4376168192
5 MyApp __22-[FPRClient logTrace:]_block_invoke + 4376166436
6 libdispatch.dylib _dispatch_call_block_and_release + 24
7 libdispatch.dylib _dispatch_client_callout + 16
8 libdispatch.dylib _dispatch_queue_serial_drain$VARIANT$armv81 + 904
9 libdispatch.dylib _dispatch_queue_invoke$VARIANT$armv81 + 328
10 libdispatch.dylib _dispatch_root_queue_drain_deferred_wlh$VARIANT$armv81 + 332
11 libdispatch.dylib _dispatch_workloop_worker_thread$VARIANT$armv81 + 612
12 libsystem_pthread.dylib _pthread_wqthread + 860
13 libsystem_pthread.dylib start_wqthread + 4
Xcode version: Xcode 11.3
Firebase SDK version: 6.14.0
Firebase Component: Core
Component version: 6.14.0
iOS 11.4.1

Vitalik13 avatar Jan 09 '20 08:01 Vitalik13

@Vitalik13 @BaluNaik Can you share all the threads that were active during the time of crash? We are guessing a probable race condition in fetching a cached value that is leading to this crash.

visumickey avatar Jan 13 '20 22:01 visumickey

@visumickey Please find the attached crash log.

CrashLog.txt

BaluNaik avatar Jan 20 '20 14:01 BaluNaik

Based on the information we have narrowed down the issue and have proposed a fix for the same. Hopefully this fixes the crash. The fix will be shipped in the upcoming release.

visumickey avatar Jan 22 '20 00:01 visumickey

Unfortunately we could not roll out the fix in this release. Though the changes were done, because of a broken internal dependency, we could not make it to this release. We are looking forward to roll this out in the upcoming release (ETA in 2 weeks).

visumickey avatar Jan 28 '20 22:01 visumickey

Unfortunately we could not roll out the fix in this release. Though the changes were done, because of a broken internal dependency, we could not make it to this release. We are looking forward to roll this out in the upcoming release (ETA in 2 weeks).

Thanks, @visumickey for now, we disable this in-app. Please let us know when this fix rollout.

BaluNaik avatar Jan 30 '20 12:01 BaluNaik

This is all scheduled for a rollout early next week.

visumickey avatar Feb 07 '20 07:02 visumickey