firebase / firebase-ios-sdk

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

Crash on GDTCORStorage.m line 313 #4876

Closed plu closed 4 years ago

plu commented 4 years ago

Step 1: Describe your environment

  - Firebase/Core (6.15.0):
    - Firebase/CoreOnly
    - FirebaseAnalytics (= 6.2.1)
  - Firebase/CoreOnly (6.15.0):
    - FirebaseCore (= 6.6.0)
  - Firebase/Messaging (6.15.0):
    - Firebase/CoreOnly
    - FirebaseMessaging (~> 4.2.0)
  - Firebase/Performance (6.15.0):
    - Firebase/CoreOnly
    - FirebasePerformance (~> 3.1.9)
  - FirebaseABTesting (3.1.2):
    - FirebaseAnalyticsInterop (~> 1.3)
    - FirebaseCore (~> 6.1)
    - Protobuf (>= 3.9.2, ~> 3.9)
  - FirebaseAnalytics (6.2.1):
    - FirebaseCore (~> 6.6)
    - FirebaseInstanceID (~> 4.3)
    - GoogleAppMeasurement (= 6.2.1)
    - GoogleUtilities/AppDelegateSwizzler (~> 6.0)
    - GoogleUtilities/MethodSwizzler (~> 6.0)
    - GoogleUtilities/Network (~> 6.0)
    - "GoogleUtilities/NSData+zlib (~> 6.0)"
    - nanopb (= 0.3.9011)
  - FirebaseAnalyticsInterop (1.5.0)
  - FirebaseCore (6.6.0):
    - FirebaseCoreDiagnostics (~> 1.2)
    - FirebaseCoreDiagnosticsInterop (~> 1.2)
    - GoogleUtilities/Environment (~> 6.5)
    - GoogleUtilities/Logger (~> 6.5)
  - FirebaseCoreDiagnostics (1.2.0):
    - FirebaseCoreDiagnosticsInterop (~> 1.2)
    - GoogleDataTransportCCTSupport (~> 1.3)
    - GoogleUtilities/Environment (~> 6.5)
    - GoogleUtilities/Logger (~> 6.5)
    - nanopb (~> 0.3.901)
  - FirebaseCoreDiagnosticsInterop (1.2.0)
  - FirebaseInstallations (1.1.0):
    - FirebaseCore (~> 6.6)
    - GoogleUtilities/UserDefaults (~> 6.5)
    - PromisesObjC (~> 1.2)
  - FirebaseInstanceID (4.3.0):
    - FirebaseCore (~> 6.6)
    - FirebaseInstallations (~> 1.0)
    - GoogleUtilities/Environment (~> 6.5)
    - GoogleUtilities/UserDefaults (~> 6.5)
  - FirebaseMessaging (4.2.0):
    - FirebaseAnalyticsInterop (~> 1.5)
    - FirebaseCore (~> 6.6)
    - FirebaseInstanceID (~> 4.3)
    - GoogleUtilities/AppDelegateSwizzler (~> 6.5)
    - GoogleUtilities/Environment (~> 6.5)
    - GoogleUtilities/Reachability (~> 6.5)
    - GoogleUtilities/UserDefaults (~> 6.5)
    - Protobuf (>= 3.9.2, ~> 3.9)
  - FirebasePerformance (3.1.9):
    - FirebaseCore (~> 6.6)
    - FirebaseInstanceID (~> 4.3)
    - FirebaseRemoteConfig (~> 4.4)
    - GoogleToolboxForMac/Logger (~> 2.1)
    - "GoogleToolboxForMac/NSData+zlib (~> 2.1)"
    - GoogleUtilities/Environment (~> 6.2)
    - GoogleUtilities/ISASwizzler (~> 6.2)
    - GoogleUtilities/MethodSwizzler (~> 6.2)
    - GTMSessionFetcher/Core (~> 1.1)
    - Protobuf (~> 3.9)
  - FirebaseRemoteConfig (4.4.6):
    - FirebaseABTesting (~> 3.1)
    - FirebaseAnalyticsInterop (~> 1.4)
    - FirebaseCore (~> 6.2)
    - FirebaseInstanceID (~> 4.2)
    - GoogleUtilities/Environment (~> 6.2)
    - "GoogleUtilities/NSData+zlib (~> 6.2)"
    - Protobuf (>= 3.9.2, ~> 3.9)
  - GoogleDataTransport (3.3.0)
  - GoogleDataTransportCCTSupport (1.3.0):
    - GoogleDataTransport (~> 3.3)
    - nanopb (~> 0.3.901)
  - GoogleIDFASupport (3.14.0)
  - GoogleToolboxForMac/Core (2.2.2):
    - GoogleToolboxForMac/Defines (= 2.2.2)
  - GoogleToolboxForMac/Defines (2.2.2)
  - GoogleToolboxForMac/GeometryUtils (2.2.2):
    - GoogleToolboxForMac/Defines (= 2.2.2)
  - GoogleToolboxForMac/Logger (2.2.2):
    - GoogleToolboxForMac/Defines (= 2.2.2)
  - "GoogleToolboxForMac/NSData+zlib (2.2.2)":
    - GoogleToolboxForMac/Defines (= 2.2.2)
  - "GoogleToolboxForMac/NSString+HTML (2.2.2)":
    - GoogleToolboxForMac/Core (= 2.2.2)
  - GoogleUtilities/AppDelegateSwizzler (6.5.0):
    - GoogleUtilities/Environment
    - GoogleUtilities/Logger
    - GoogleUtilities/Network
  - GoogleUtilities/Environment (6.5.0)
  - GoogleUtilities/ISASwizzler (6.5.0)
  - GoogleUtilities/Logger (6.5.0):
    - GoogleUtilities/Environment
  - GoogleUtilities/MethodSwizzler (6.5.0):
    - GoogleUtilities/Logger
  - GoogleUtilities/Network (6.5.0):
    - GoogleUtilities/Logger
    - "GoogleUtilities/NSData+zlib"
    - GoogleUtilities/Reachability
  - "GoogleUtilities/NSData+zlib (6.5.0)"
  - GoogleUtilities/Reachability (6.5.0):
    - GoogleUtilities/Logger
  - GoogleUtilities/UserDefaults (6.5.0):
    - GoogleUtilities/Logger
  - GTMSessionFetcher/Core (1.3.1)

Step 2: Describe the problem

Crashed: com.apple.main-thread
0  libobjc.A.dylib                0x1aeaf4fb0 objc_msgSend + 16
1  Foundation                     0x1af19a5dc <redacted> + 212
2  Foundation                     0x1af119a7c <redacted> + 268
3  Foundation                     0x1af19a9c4 <redacted> + 1212
4  Kleinanzeigen                  0x104d79ee8 -[GDTCORStorage encodeWithCoder:] + 313 (GDTCORStorage.m:313)
5  Foundation                     0x1af19a9c4 <redacted> + 1212
6  Foundation                     0x1af0ade1c <redacted> + 116
7  Kleinanzeigen                  0x104d79acc -[GDTCORStorage appWillTerminate:] + 262 (GDTCORStorage.m:262)
8  Kleinanzeigen                  0x104d76fc4 -[GDTCORLifecycle applicationWillTerminate:] + 109 (GDTCORLifecycle.m:109)
9  Foundation                     0x1af1aaffc <redacted> + 28
10 CoreFoundation                 0x1aed3899c <redacted> + 28
11 CoreFoundation                 0x1aed389ec <redacted> + 68
12 CoreFoundation                 0x1aed37ce4 <redacted> + 396
13 CoreFoundation                 0x1aed3797c <redacted> + 108
14 CoreFoundation                 0x1aecb0910 <redacted> + 1424
15 CoreFoundation                 0x1aed372ac _CFXNotificationPost + 1268
16 Foundation                     0x1af099b8c <redacted> + 64
17 Kleinanzeigen                  0x104d775c0 -[GDTCORApplication iOSApplicationWillTerminate:] + 192 (GDTCORPlatform.m:192)
18 Foundation                     0x1af1aaffc <redacted> + 28
19 CoreFoundation                 0x1aed3899c <redacted> + 28
20 CoreFoundation                 0x1aed389ec <redacted> + 68
21 CoreFoundation                 0x1aed37ce4 <redacted> + 396
22 CoreFoundation                 0x1aed3797c <redacted> + 108
23 CoreFoundation                 0x1aecb0910 <redacted> + 1424
24 CoreFoundation                 0x1aed372ac _CFXNotificationPost + 1268
25 Foundation                     0x1af099b8c <redacted> + 64
26 UIKitCore                      0x1b2ee6bf8 <redacted> + 304
27 UIKitCore                      0x1b26782d0 <redacted> + 128
28 UIKitCore                      0x1b2677f2c <redacted> + 220
29 UIKitCore                      0x1b2edcdd4 <redacted> + 216
30 FrontBoardServices             0x1b3fce98c <redacted> + 88
31 FrontBoardServices             0x1b3ffc264 <redacted> + 80
32 FrontBoardServices             0x1b3fe0ef4 <redacted> + 240
33 FrontBoardServices             0x1b3ffc1f0 <redacted> + 140
34 libdispatch.dylib              0x1aea85fd8 <redacted> + 20
35 libdispatch.dylib              0x1aea88d1c <redacted> + 264
36 FrontBoardServices             0x1b4023254 <redacted> + 48
37 FrontBoardServices             0x1b4022f00 <redacted> + 432
38 FrontBoardServices             0x1b402346c <redacted> + 32
39 CoreFoundation                 0x1aed5c108 <redacted> + 28
40 CoreFoundation                 0x1aed5c05c <redacted> + 84
41 CoreFoundation                 0x1aed5b7c8 <redacted> + 184
42 CoreFoundation                 0x1aed56694 <redacted> + 1068
43 CoreFoundation                 0x1aed55f40 CFRunLoopRunSpecific + 480
44 GraphicsServices               0x1b8fe6534 GSEventRunModal + 108
45 UIKitCore                      0x1b2ee1580 UIApplicationMain + 1940
46 Kleinanzeigen                  0x104850b30 main + 12 (AppDelegate.swift:12)
47 libdyld.dylib                  0x1aebd4e18 <redacted> + 4

Steps to reproduce:

No idea, sorry.

Relevant Code:

All write access to GDTCORStorage->__targetToEventSet is done via _storageQueue. But in appWillTerminate you're accessing __targetToEventSet from the main thread, which is probably causing the crash if at the same time __targetToEventSet is being written from _storageQueue.

google-oss-bot commented 4 years ago

I found a few problems with this issue:

rizafran commented 4 years ago

Hi @plu, Duplicate of #4546 since the crash logs look similar. Feel free to contribute any significant info that might help to investigate the issue on that thread.

plu commented 4 years ago

Thanks @rizafran, I've added a small test case to reproduce the issue on #4546.