firebase-ios-sdk: Crashed: com.google.fira.worker when opening the app

[REQUIRED] Step 2: Describe your environment

  • Xcode version: 9.2
  • Firebase SDK version: 4.10.1
  • Firebase Component: Core (4.10.1), FirebaseAnalytics (4.1.0)
  • iPhone 7, iOS 11.0.3 (15A432)

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

Users reported that app crash right after opening the App. We didn’t had this crash before updating Firebase to the newest pod version.

Crash Message:

Crashed: com.google.fira.worker
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000000

Thread stacktrace:

Crashed: com.google.fira.worker
0  libsystem_platform.dylib       0x1808c5bd8 _platform_memmove + 296
1  nanopb                         0x105d3905c pb_field_set_to_default (pb_decode.c:808)
2  nanopb                         0x105d3905c pb_field_set_to_default (pb_decode.c:808)
3  nanopb                         0x105d3876c pb_message_set_to_defaults (pb_decode.c:845)
4  nanopb                         0x105d38720 pb_decode (pb_decode.c:959)
5  <Appname>                      0x10374c524 firapb_decode_measurement_config + 4312057124
6  <Appname>                      0x103751098 -[FIRAPBMeasurementConfig initWithBuffer:] + 4312076440
7  <Appname>                       0x103728808 __72-[FIRAMeasurement networkRemoteConfigFetchCompletionHandler:data:error:]_block_invoke.1431 + 4311910408
8  <Appname>                       0x103702eb4 -[FIRASqliteStore performTransaction:] + 4311756468
9  <Appname>                       0x103728428 -[FIRAMeasurement networkRemoteConfigFetchCompletionHandler:data:error:] + 4311909416
10 <Appname>                      0x103727d84 __36-[FIRAMeasurement fetchRemoteConfig]_block_invoke + 4311907716
11 libdispatch.dylib              0x180629088 _dispatch_call_block_and_release + 24
12 libdispatch.dylib              0x180629048 _dispatch_client_callout + 16
13 libdispatch.dylib              0x180632e48 _dispatch_queue_serial_drain$VARIANT$mp + 528
14 libdispatch.dylib              0x1806337d8 _dispatch_queue_invoke$VARIANT$mp + 340
15 libdispatch.dylib              0x180634200 _dispatch_root_queue_drain_deferred_wlh$VARIANT$mp + 400
16 libdispatch.dylib              0x18063c4a0 _dispatch_workloop_worker_thread$VARIANT$mp + 644
17 libsystem_pthread.dylib        0x1808cefe0 _pthread_wqthread + 932
18 libsystem_pthread.dylib        0x1808cec30 start_wqthread + 4

Podfile.lock:

PODS:
  - Alamofire (4.5.1)
  - Bolts (1.8.4):
    - Bolts/AppLinks (= 1.8.4)
    - Bolts/Tasks (= 1.8.4)
  - Bolts/AppLinks (1.8.4):
    - Bolts/Tasks
  - Bolts/Tasks (1.8.4)
  - CocoaLumberjack (2.4.0):
    - CocoaLumberjack/Default (= 2.4.0)
    - CocoaLumberjack/Extensions (= 2.4.0)
  - CocoaLumberjack/Core (2.4.0)
  - CocoaLumberjack/Default (2.4.0):
    - CocoaLumberjack/Core
  - CocoaLumberjack/Extensions (2.4.0):
    - CocoaLumberjack/Default
  - Crashlytics (3.9.3):
    - Fabric (~> 1.7.2)
  - Device (3.0.3)
  - DynamicColor (4.0.1)
  - ESTabBarController-swift (2.6)
  - Fabric (1.7.2)
  - FBSDKCoreKit (4.29.0):
    - Bolts (~> 1.7)
  - FBSDKLoginKit (4.29.0):
    - FBSDKCoreKit
  - Firebase (4.10.1):
    - Firebase/Core (= 4.10.1)
  - Firebase/Core (4.10.1):
    - FirebaseAnalytics (= 4.1.0)
    - FirebaseCore (= 4.0.17)
  - FirebaseAnalytics (4.1.0):
    - FirebaseCore (~> 4.0)
    - FirebaseInstanceID (~> 2.0)
    - GoogleToolboxForMac/NSData+zlib (~> 2.1)
    - nanopb (~> 0.3)
  - FirebaseAppIndexing (1.2.0)
  - FirebaseCore (4.0.17):
    - GoogleToolboxForMac/NSData+zlib (~> 2.1)
  - FirebaseInstanceID (2.0.9):
    - FirebaseCore (~> 4.0)
  - GoogleAnalytics (3.17.0)
  - GoogleIDFASupport (3.14.0)
  - GoogleTagManager (3.15.2):
    - GoogleAnalytics (= 3.17.0)
  - GoogleToolboxForMac/Defines (2.1.3)
  - GoogleToolboxForMac/NSData+zlib (2.1.3):
    - GoogleToolboxForMac/Defines (= 2.1.3)
  - Kingfisher (3.13.1)
  - lottie-ios (2.1.5)
  - LUKeychainAccess (1.2.5)
  - MBProgressHUD (0.9.2)
  - Moya (8.0.5):
    - Moya/Core (= 8.0.5)
  - Moya-ObjectMapper (2.4):
    - Moya-ObjectMapper/Core (= 2.4)
  - Moya-ObjectMapper/Core (2.4):
    - Moya (~> 8.0)
    - ObjectMapper (~> 2.2)
  - Moya/Core (8.0.5):
    - Alamofire (~> 4.1)
    - Result (~> 3.0)
  - nanopb (0.3.8):
    - nanopb/decode (= 0.3.8)
    - nanopb/encode (= 0.3.8)
  - nanopb/decode (0.3.8)
  - nanopb/encode (0.3.8)
  - ObjectMapper (2.2.9)
  - OCMock (3.4)
  - ProtocolBuffers-Swift (3.0.23)
  - PureLayout (3.0.2)
  - Result (3.2.3)
  - SwiftyStoreKit (0.11.1)

DEPENDENCIES:
  - Alamofire
  - CocoaLumberjack (~> 2.4.0)
  - Crashlytics (~> 3.9)
  - Device
  - DynamicColor (from `https://github.com/puelocesar/DynamicColor.git`, commit `cf9478bbc2dfda8895cb3630418ba53e3d680eca`)
  - ESTabBarController-swift (from `https://github.com/eggswift/ESTabBarController`, tag `2.6`)
  - Fabric (~> 1.7.0)
  - FBSDKCoreKit (~> 4.29.0)
  - FBSDKLoginKit (~> 4.29.0)
  - Firebase (~> 4.10.1)
  - FirebaseAppIndexing
  - FirebaseCore
  - GoogleIDFASupport
  - GoogleTagManager
  - Kingfisher (~> 3.x)
  - lottie-ios
  - LUKeychainAccess (~> 1.2.0)
  - MBProgressHUD (~> 0.9.2)
  - Moya (~> 8.0.0)
  - Moya-ObjectMapper
  - OCMock (~> 3.2)
  - ProtocolBuffers-Swift
  - PureLayout
  - SwiftyStoreKit

EXTERNAL SOURCES:
  DynamicColor:
    :commit: cf9478bbc2dfda8895cb3630418ba53e3d680eca
    :git: https://github.com/puelocesar/DynamicColor.git
  ESTabBarController-swift:
    :git: https://github.com/eggswift/ESTabBarController
    :tag: 2.6

CHECKOUT OPTIONS:
  DynamicColor:
    :commit: cf9478bbc2dfda8895cb3630418ba53e3d680eca
    :git: https://github.com/puelocesar/DynamicColor.git
  ESTabBarController-swift:
    :git: https://github.com/eggswift/ESTabBarController
    :tag: 2.6

SPEC CHECKSUMS:
  Alamofire: 2d95912bf4c34f164fdfc335872e8c312acaea4a
  Bolts: 8a7995239dbe724f9cba2248b766d48b7ebdd322
  CocoaLumberjack: aa9dcab71bdf9eaf2a63bbd9ddc87863efe45457
  Crashlytics: dbb07d01876c171c5ccbdf7826410380189e452c
  Device: 9a5264ee4e0f392e7153d2c46b10c8df46b7aad2
  DynamicColor: 22bbab2db3bffb03a731ed8f001feaec5bea6ba6
  ESTabBarController-swift: d5e7dd83b06917d9805111de063c8edd9468e485
  Fabric: 9cd6a848efcf1b8b07497e0b6a2e7d336353ba15
  FBSDKCoreKit: 6f139173dc63a1deaff4430a55f2fe5bb222d2af
  FBSDKLoginKit: 56a057ca6822535ea0faa25f57a7c41edb697fd4
  Firebase: 92c6ba593e32db0defde464a9adc981d5cb49f97
  FirebaseAnalytics: 3dfae28d4a5e06f86c4fae830efc2ad3fadb19bc
  FirebaseAppIndexing: adf2f3b14b6828f1d4c539fc72434962cf29ea2c
  FirebaseCore: 872307b001bbefda1dfa0dbfffa50a6919023d4a
  FirebaseInstanceID: d2058a35e9bebda1b6dd42486b84917bde552a9d
  GoogleAnalytics: f42cc53a87a51fe94334821868d9c8481ff47a7b
  GoogleIDFASupport: aaf8c10bd429abb1c15349d5252244f5eda8ead1
  GoogleTagManager: 43b61f634e42e4b9566ab41e9fd6aa0f6adf47a5
  GoogleToolboxForMac: 2501e2ad72a52eb3dfe7bd9aee7dad11b858bd20
  Kingfisher: ed9707a409cc47fddafbcd12a43a9757e3600af5
  lottie-ios: 836cdbba92f62f3c6a00e37a4ce485321fe317cf
  LUKeychainAccess: d22fc00b33ad92c7532962b86daa94c14b85ecbe
  MBProgressHUD: 1569cf7ace17a8bac47aabfbb8580a49690386d1
  Moya: c37eec09a098ba9991b5a963b291fc5704bdb9ef
  Moya-ObjectMapper: 5807a3f30fea8fd07a9fc0e324cda1655e1602ab
  nanopb: 5601e6bca2dbf1ed831b519092ec110f66982ca3
  ObjectMapper: 63cfe41bc6f8e7c8f44344c49901b8ae7de14c52
  OCMock: 35ae71d6a8fcc1b59434d561d1520b9dd4f15765
  ProtocolBuffers-Swift: e0b959c0fbb5dcadb3846f9b42c2cbfae6918422
  PureLayout: 4d550abe49a94f24c2808b9b95db9131685fe4cd
  Result: 128640a6347e8d2ae48b142556739a2d13f90ce6
  SwiftyStoreKit: d52d1473f5baf8385c86d7455c9f6b0d0a74cef2

PODFILE CHECKSUM: 0435e038b75d5be9e4cd0e98a6ed9aa130217f8f

COCOAPODS: 1.4.0

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 18 (3 by maintainers)

Most upvoted comments

OK, just found the reason why it was crashing, hope it might help someone - in fastlane, we had:

gym( ... xcargs: "GCC_PREPROCESSOR_DEFINITIONS='SOMEFLAG=1'", ....)

which removed all other defines, so replacing it with:

gym( ... xcargs: "GCC_PREPROCESSOR_DEFINITIONS='$(inherited) SOMEFLAG=1'", ....)

fixed the crash.

Thanks to @xaverlohmueller, adding GoogleToolboxForMac.framework fixed my problem.

I think you have to set PB_FIELD_32BIT=1 PB_NO_PACKED_STRUCTS=1 in your GCC_PREPROCESSOR_DEFINITIONS for your xcodebuild. Otherwise nanopb will crash during runtime, which is used by FIRAPBMeasurementConfig. Normally the configuration is inherited, be sure you don’t override the GCC_PREPROCESSOR_DEFINITIONS as we accidentally. So now it works for us.

Hi!

Seems we are experiencing the same crash (XCode version: 9.3):

Crashed: com.google.fira.worker
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000000

Stack trace:

0 libsystem_platform.dylib _platform_memmove + 296
1 nanopb pb_decode.c - Line 808 pb_field_set_to_default
2 nanopb pb_decode.c - Line 808 pb_field_set_to_default
3 nanopb pb_decode.c - Line 845 pb_message_set_to_defaults
4 nanopb pb_decode.c - Line 959 pb_decode
5 <appname> firapb_decode_measurement_config + 4301485280
6 <appname> -[FIRAPBMeasurementConfig initWithBuffer:] + 4301502176
7 <appname> __72-[FIRAMeasurement networkRemoteConfigFetchCompletionHandler:data:error:]_block_invoke.1476 + 4301330024
8 <appname> -[FIRASqliteStore performTransaction:] + 4301172296
9 <appname> -[FIRAMeasurement networkRemoteConfigFetchCompletionHandler:data:error:] + 4301329072
10 <appname> __36-[FIRAMeasurement fetchRemoteConfig]_block_invoke + 4301327380
11 libdispatch.dylib _dispatch_call_block_and_release + 24
12 libdispatch.dylib _dispatch_client_callout + 16
13 libdispatch.dylib _dispatch_queue_serial_drain$VARIANT$mp + 608
14 libdispatch.dylib _dispatch_queue_invoke$VARIANT$mp + 336
15 libdispatch.dylib _dispatch_root_queue_drain_deferred_wlh$VARIANT$mp + 340
16 libdispatch.dylib _dispatch_workloop_worker_thread$VARIANT$mp + 668
17 libsystem_pthread.dylib _pthread_wqthread + 860
18 libsystem_pthread.dylib start_wqthread + 4

PODS:

PODS:
  - Crashlytics (3.10.1):
    - Fabric (~> 1.7.5)
  - DynamicBlurView (2.0.2)
  - Fabric (1.7.6)
  - Firebase/Core (5.0.0):
    - Firebase/CoreOnly
    - FirebaseAnalytics (= 5.0.0)
  - Firebase/CoreOnly (5.0.0):
    - FirebaseCore (= 5.0.0)
  - FirebaseAnalytics (5.0.0):
    - FirebaseCore (~> 5.0)
    - FirebaseInstanceID (~> 3.0)
    - "GoogleToolboxForMac/NSData+zlib (~> 2.1)"
    - nanopb (~> 0.3)
  - FirebaseCore (5.0.0):
    - "GoogleToolboxForMac/NSData+zlib (~> 2.1)"
  - FirebaseInstanceID (3.0.0):
    - FirebaseCore (~> 5.0)
  - GoogleToolboxForMac/Defines (2.1.4)
  - "GoogleToolboxForMac/NSData+zlib (2.1.4)":
    - GoogleToolboxForMac/Defines (= 2.1.4)
  - nanopb (0.3.8):
    - nanopb/decode (= 0.3.8)
    - nanopb/encode (= 0.3.8)
  - nanopb/decode (0.3.8)
  - nanopb/encode (0.3.8)
  - PopupDialog (0.7.1):
    - DynamicBlurView (~> 2.0)

The crash is 100% reproducible using below steps:

  1. make sure application is NOT installed,
  2. install the application,
  3. run the application,
  4. on first screen (or any screen for that matter) put the application into background and back to foreground.

This will cause application to crash (not sure when the app crashes - either when going to background or when coming back to foreground) - bottom point is that it crashes 10/10.

Notes:

  1. from this point on, application works without any problems and cannot reproduce the crash anymore unless we repeat all the above steps (so 1 crash per install);
  2. not 100% sure, but it seems the crash only happens when app is builded on the build server - build with an enterprise certificate, not sure if this makes any sense to anybody, but we cannot reproduce the crash on developer machines, only with builds coming from build server and the only difference I can think of is the signing.

I still this bugs in the latest version.