Skip to content

[BUG]: Crash in FIRInstanceIDAuthKeyChain.m line 79 -[FIRInstanceIDAuthKeychain itemsMatchingService:account:] #4205

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
skuske opened this issue Oct 31, 2019 · 21 comments

Comments

@skuske
Copy link

skuske commented Oct 31, 2019

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

Yes, I think so... :o)

[REQUIRED] Step 2: Describe your environment

  • Xcode version: Version 11.1 (11A1027)
  • Firebase SDK version: 6.10
  • Firebase Component: Analytics, Fabric, Crashlytics, Performance, RemoteConfig
  • Component version: RemoteConfig 4.4.3

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

Crash reported by Crashlytics:

iOS 13.2.0 (17B84)
iPad Pro (12.9-inch, 2nd generation)

FIRInstanceIDAuthKeyChain.m line 79
-[FIRInstanceIDAuthKeychain itemsMatchingService:account:]

Stack Trace 1:

Crashed: com.google.GoogleConfigService.FIRRemoteConfig
0  CoreFoundation                 0x18467f214 <redacted> + 144
1  AppName                        0x10279c460 -[FIRInstanceIDAuthKeychain itemsMatchingService:account:] + 79 (FIRInstanceIDAuthKeyChain.m:79)
2  AppName                        0x10279ca64 -[FIRInstanceIDAuthKeychain dataForService:account:] + 142 (FIRInstanceIDAuthKeyChain.m:142)
3  AppName                        0x1027abc78 -[FIRInstanceIDTokenStore tokenInfoWithAuthorizedEntity:scope:] + 59 (FIRInstanceIDTokenStore.m:59)
4  AppName                        0x1027a61a4 -[FIRInstanceIDStore tokenInfoWithAuthorizedEntity:scope:] + 191 (FIRInstanceIDStore.m:191)
5  AppName                        0x1027a9884 -[FIRInstanceIDTokenManager cachedTokenInfoWithAuthorizedEntity:scope:] + 141 (FIRInstanceIDTokenManager.m:141)
6  AppName                        0x102797578 __65-[FIRInstanceID tokenWithAuthorizedEntity:scope:options:handler:]_block_invoke.127 + 336 (FIRInstanceID.m:336)
7  AppName                        0x10279e17c -[FIRInstanceIDAuthService notifyCheckinHandlersWithCheckin:error:] + 286 (FIRInstanceIDAuthService.m:286)
8  AppName                        0x10279db4c -[FIRInstanceIDAuthService fetchCheckinInfoWithHandler:] + 181 (FIRInstanceIDAuthService.m:181)
9  AppName                        0x1027972ac -[FIRInstanceID tokenWithAuthorizedEntity:scope:options:handler:] + 368 (FIRInstanceID.m:368)
10 AppName                        0x102821f68 -[RCNConfigFetch refreshInstanceIDTokenAndFetchCheckInInfoWithCompletionHandler:] + 230 (RCNFetch.m:230)
11 AppName                        0x102821bd8 __74-[RCNConfigFetch fetchAllConfigsWithExpirationDuration:completionHandler:]_block_invoke + 190 (RCNFetch.m:190)
12 libdispatch.dylib              0x184470610 <redacted> + 24
13 libdispatch.dylib              0x184471184 <redacted> + 16
14 libdispatch.dylib              0x18441d404 <redacted> + 608
15 libdispatch.dylib              0x18441ddf8 <redacted> + 420
16 libdispatch.dylib              0x184427314 <redacted> + 588
17 libsystem_pthread.dylib        0x1844c0f88 _pthread_wqthread + 276
18 libsystem_pthread.dylib        0x1844c3ad4 start_wqthread + 8

Steps to reproduce:

We cannot reproduce the issue, and it seems to be very rare.

Relevant Code:

Internal firebase crash, not sure if any of our code is directly related.

@google-oss-bot

This comment has been minimized.

@skuske
Copy link
Author

skuske commented Oct 31, 2019

Maybe related to #4172 ?

@charlotteliang
Copy link
Contributor

@skuske can you share the full stack trace, specifically the error message on top saying why it crash.

@skuske
Copy link
Author

skuske commented Oct 31, 2019

@chliangGoogle

Crashed: com.google.GoogleConfigService.FIRRemoteConfig
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000010
-[FIRInstanceIDAuthKeychain itemsMatchingService:account:]

Stack trace 2:

com.apple.main-thread
0  libsystem_kernel.dylib         0x18459c8b8 __ulock_wait + 8
1  libsystem_platform.dylib       0x1844aef54 <redacted> + 224
2  libobjc.A.dylib                0x1844dfde0 objc_sync_enter + 32
3  AppName                        0x10279da38 -[FIRInstanceIDAuthService fetchCheckinInfoWithHandler:] + 169 (FIRInstanceIDAuthService.m:169)
4  AppName                        0x1027972ac -[FIRInstanceID tokenWithAuthorizedEntity:scope:options:handler:] + 368 (FIRInstanceID.m:368)
5  AppName                        0x10279a234 -[FIRInstanceID defaultTokenWithRetry:handler:] + 949 (FIRInstanceID.m:949)
6  AppName                        0x102799978 -[FIRInstanceID didCompleteConfigure] + 717 (FIRInstanceID.m:717)
7  AppName                        0x1027996cc -[FIRInstanceID configureInstanceIDWithOptions:app:] + 681 (FIRInstanceID.m:681)
8  AppName                        0x102799560 +[FIRInstanceID configureWithApp:] + 663 (FIRInstanceID.m:663)
9  AppName                        0x10278e7a0 +[FIRApp sendNotificationsToSDKs:] + 425 (FIRApp.m:425)
10 AppName                        0x10278d9ac +[FIRApp configureWithName:options:] + 195 (FIRApp.m:195)
11 AppName                        0x10278d624 +[FIRApp configureWithOptions:] + 139 (FIRApp.m:139)
12 AppName                        0x10278d5ac +[FIRApp configure] + 131 (FIRApp.m:131)
13 AppName                        0x102620368 -[AppDelegate application:didFinishLaunchingWithOptions:] + 1759 (AppDelegate.m:1759)
14 UIKitCore                      0x188802ef4 <redacted> + 340
15 UIKitCore                      0x188804d20 <redacted> + 5076
16 UIKitCore                      0x18880a554 <redacted> + 1304
17 UIKitCore                      0x187fd8cdc <redacted> + 148
18 UIKitCore                      0x18846dfc4 _UIScenePerformActionsWithLifecycleActionMask + 100
19 UIKitCore                      0x187fd97c4 <redacted> + 196
20 UIKitCore                      0x187fd921c <redacted> + 296
21 UIKitCore                      0x187fd95f0 <redacted> + 736
22 UIKitCore                      0x187fd8eac <redacted> + 336
23 UIKitCore                      0x187fdd3c8 <redacted> + 188
24 UIKitCore                      0x1883a06a4 <redacted> + 824
25 UIKitCore                      0x1884875b0 _UISceneSettingsDiffActionPerformChangesWithTransitionContext + 244
26 UIKitCore                      0x187fdd100 <redacted> + 136
27 UIKitCore                      0x1884874ac _UISceneSettingsDiffActionPerformActionsWithDelayForTransitionContext + 100
28 UIKitCore                      0x187fdcf6c <redacted> + 376
29 UIKitCore                      0x187e4eba4 <redacted> + 636
30 UIKitCore                      0x187e4d70c <redacted> + 248
31 UIKitCore                      0x187e4e8dc <redacted> + 220
32 UIKitCore                      0x1888088d4 <redacted> + 548
33 UIKitCore                      0x1883c109c <redacted> + 360
34 FrontBoardServices             0x1898a8850 <redacted> + 436
35 FrontBoardServices             0x1898cd8e8 <redacted> + 100
36 FrontBoardServices             0x1898b2fb4 <redacted> + 232
37 FrontBoardServices             0x1898cd5a4 <redacted> + 312
38 libdispatch.dylib              0x184471184 <redacted> + 16
39 libdispatch.dylib              0x184419fd8 <redacted> + 224
40 FrontBoardServices             0x1898f24c8 <redacted> + 40
41 FrontBoardServices             0x1898f2194 <redacted> + 404
42 FrontBoardServices             0x1898f26bc <redacted> + 28
43 CoreFoundation                 0x1847217c4 <redacted> + 24
44 CoreFoundation                 0x18472171c <redacted> + 80
45 CoreFoundation                 0x184720eb4 <redacted> + 180
46 CoreFoundation                 0x18471c000 <redacted> + 1080
47 CoreFoundation                 0x18471b8a0 CFRunLoopRunSpecific + 464
48 GraphicsServices               0x18e673328 GSEventRunModal + 104
49 UIKitCore                      0x18880c768 UIApplicationMain + 1936
50 AppName                        0x1027204e0 main + 225 (main.m:225)
51 libdyld.dylib                  0x1845a6360 <redacted> + 4

Stack trace 3:

com.google.FIRCoreDiagnostics
0  libsystem_kernel.dylib         0x18459c8b8 __ulock_wait + 8
1  libsystem_platform.dylib       0x1844aef54 <redacted> + 224
2  libobjc.A.dylib                0x1844dfde0 objc_sync_enter + 32
3  AppName                        0x10278db50 +[FIRApp allApps] + 224 (FIRApp.m:224)
4  AppName                        0x102791af4 -[FIRDiagnosticsData diagnosticObjects] + 47 (FIRDiagnosticsData.m:47)
5  AppName                        0x102795eb0 __42-[FIRCoreDiagnostics sendDiagnosticsData:]_block_invoke + 614 (FIRCoreDiagnostics.m:614)
6  libdispatch.dylib              0x184470610 <redacted> + 24
7  libdispatch.dylib              0x184471184 <redacted> + 16
8  libdispatch.dylib              0x18441d404 <redacted> + 608
9  libdispatch.dylib              0x18441ddf8 <redacted> + 420
10 libdispatch.dylib              0x184427314 <redacted> + 588
11 libsystem_pthread.dylib        0x1844c0f88 _pthread_wqthread + 276
12 libsystem_pthread.dylib        0x1844c3ad4 start_wqthread + 8

@Decsunshine
Copy link

I have encountered the same problem

@charlotteliang
Copy link
Contributor

@skuske @Decsunshine Can any of you share the full stack trace, It seems to related to remote config and performance, would be great to see the all the threads interaction during crash.

@skuske
Copy link
Author

skuske commented Nov 4, 2019

@chliangGoogle

Sure, here are the other stack traces:

4:

Thread
0  libsystem_kernel.dylib         0x18459ca7c __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1844c0fd4 _pthread_wqthread + 352
2  libsystem_pthread.dylib        0x1844c3ad4 start_wqthread + 8

5:

APMPersistedConfig
0  libsystem_kernel.dylib         0x18457a634 mach_msg_trap + 8
1  libsystem_kernel.dylib         0x184579aa0 mach_msg + 72
2  libdispatch.dylib              0x18442c7cc <redacted> + 564
3  libdispatch.dylib              0x18442cb94 <redacted> + 52
4  libxpc.dylib                   0x184370440 xpc_connection_send_message_with_reply_sync + 236
5  CoreFoundation                 0x1846cea80 <redacted> + 56
6  CoreFoundation                 0x184683d30 <redacted> + 48
7  CoreFoundation                 0x1846cea1c <redacted> + 192
8  CoreFoundation                 0x1846ced54 <redacted> + 300
9  CoreFoundation                 0x1846cdb40 <redacted> + 908
10 CoreFoundation                 0x1847cf3fc <redacted> + 404
11 CoreFoundation                 0x1847cf76c <redacted> + 36
12 CoreFoundation                 0x18470a054 <redacted> + 1032
13 CoreFoundation                 0x1847cf3fc <redacted> + 404
14 CoreFoundation                 0x1847cf76c <redacted> + 36
15 CoreFoundation                 0x18467f9a4 <redacted> + 64
16 CoreFoundation                 0x1847d77d4 <redacted> + 64
17 CoreFoundation                 0x18470c87c <redacted> + 376
18 CoreFoundation                 0x18470c114 <redacted> + 356
19 CoreFoundation                 0x18467c340 <redacted> + 124
20 CoreFoundation                 0x18467f3f8 <redacted> + 108
21 CoreFoundation                 0x1847da9e0 _CFPreferencesSetAppValueWithContainerAndConfiguration + 132
22 AppName                        0x1028806ec -[APMUserDefaults setObject:forKey:] + 4334143212
23 libdispatch.dylib              0x184471184 <redacted> + 16
24 libdispatch.dylib              0x184423c04 <redacted> + 56
25 AppName                        0x102858674 -[APMPersistedConfig setDeferredAnalyticsCollection:] + 4333979252
26 AppName                        0x1028428c4 -[APMMeasurement setEnabledOnWorkerQueue:] + 4333889732
27 AppName                        0x10285d370 __51-[APMScheduler scheduleOnWorkerQueueBlockID:block:]_block_invoke + 4333998960
28 libdispatch.dylib              0x184470610 <redacted> + 24
29 libdispatch.dylib              0x184471184 <redacted> + 16
30 libdispatch.dylib              0x18441d404 <redacted> + 608
31 libdispatch.dylib              0x18441ddf8 <redacted> + 420
32 libdispatch.dylib              0x184427314 <redacted> + 588
33 libsystem_pthread.dylib        0x1844c0f88 _pthread_wqthread + 276
34 libsystem_pthread.dylib        0x1844c3ad4 start_wqthread + 8

6:

com.apple.uikit.eventfetch-thread
0  libsystem_kernel.dylib         0x18457a634 mach_msg_trap + 8
1  libsystem_kernel.dylib         0x184579aa0 mach_msg + 72
2  CoreFoundation                 0x18472104c <redacted> + 216
3  CoreFoundation                 0x18471c16c <redacted> + 1444
4  CoreFoundation                 0x18471b8a0 CFRunLoopRunSpecific + 464
5  Foundation                     0x184a5b824 <redacted> + 228
6  Foundation                     0x184a5b704 <redacted> + 88
7  UIKitCore                      0x1888a5180 <redacted> + 152
8  Foundation                     0x184b8c0c4 <redacted> + 848
9  libsystem_pthread.dylib        0x1844c01d0 _pthread_start + 124
10 libsystem_pthread.dylib        0x1844c3ae0 thread_start + 8

7:

Thread
0  libsystem_pthread.dylib        0x1844c3acc <redacted> + 190

8:

com.apple.CFNetwork.Connection
0  libsystem_info.dylib           0x18463be98 <redacted> + 416
1  libsystem_info.dylib           0x18463fcf8 <redacted> + 176
2  libsystem_info.dylib           0x18463fbc8 <redacted> + 308
3  libsystem_info.dylib           0x18463cc24 <redacted> + 52
4  libsystem_info.dylib           0x184658e14 si_service_byname + 100
5  libsystem_info.dylib           0x184650404 <redacted> + 148
6  libsystem_info.dylib           0x184658e14 si_service_byname + 100
7  libsystem_info.dylib           0x1846479c8 getservbyname + 36
8  libnetwork.dylib               0x186d19494 <redacted> + 1268
9  libnetwork.dylib               0x186c2ed28 nw_parameters_set_url + 104
10 CFNetwork                      0x187b96208 _CFNetworkHTTPConnectionCacheSetLimit + 217044
11 CFNetwork                      0x187aeb0c0 _CFStreamErrorFromCFError + 267996
12 CFNetwork                      0x187a7d520 CFURLDownloadCancel + 48732
13 CFNetwork                      0x187aea82c _CFStreamErrorFromCFError + 265800
14 CFNetwork                      0x187aee18c _CFStreamErrorFromCFError + 280488
15 CFNetwork                      0x187aee2dc _CFStreamErrorFromCFError + 280824
16 libdispatch.dylib              0x184470610 <redacted> + 24
17 libdispatch.dylib              0x184471184 <redacted> + 16
18 libdispatch.dylib              0x18441d404 <redacted> + 608
19 libdispatch.dylib              0x18441de28 <redacted> + 468
20 libdispatch.dylib              0x18441ef7c <redacted> + 1796
21 libdispatch.dylib              0x184427314 <redacted> + 588
22 libsystem_pthread.dylib        0x1844c0f88 _pthread_wqthread + 276
23 libsystem_pthread.dylib        0x1844c3ad4 start_wqthread + 8

9:

com.twitter.crashlytics.ios.MachExceptionServer
0  AppName                        0x102758450 CLSProcessRecordAllThreads + 376 (CLSProcess.c:376)
1  AppName                        0x102758838 CLSProcessRecordAllThreads + 407 (CLSProcess.c:407)
2  AppName                        0x10274853c CLSHandler + 26 (CLSHandler.m:26)
3  AppName                        0x102743fb8 CLSMachExceptionServer + 446 (CLSMachException.c:446)
4  libsystem_pthread.dylib        0x1844c01d0 _pthread_start + 124
5  libsystem_pthread.dylib        0x1844c3ae0 thread_start + 8

10:

Thread
0  libsystem_kernel.dylib         0x18459ca7c __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1844c0fd4 _pthread_wqthread + 352
2  libsystem_pthread.dylib        0x1844c3ad4 start_wqthread + 8

11:

Thread
0  libsystem_kernel.dylib         0x18459ca7c __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1844c0fd4 _pthread_wqthread + 352
2  libsystem_pthread.dylib        0x1844c3ad4 start_wqthread + 8

12:

Thread
0  libsystem_pthread.dylib        0x1844c3acc <redacted> + 190

13:

Thread
0  libsystem_pthread.dylib        0x1844c3acc <redacted> + 190

14:

Thread
0  libsystem_pthread.dylib        0x1844c3acc <redacted> + 190

Hope that helps... :o)

@charlotteliang
Copy link
Contributor

@Decsunshine can you also share the stack trace of ALL the threads?

@Decsunshine
Copy link

@chliangGoogle

stack traces

#21. Crashed: com.apple.root.default-qos
0  libobjc.A.dylib                0x1b88ef06c objc_retain + 76
1  ABCDE                          0x107850d44 -[FIRInstanceIDAuthKeychain itemsMatchingService:account:] + 79 (FIRInstanceIDAuthKeyChain.m:79)
2  ABCDE                          0x107851360 -[FIRInstanceIDAuthKeychain dataForService:account:] + 142 (FIRInstanceIDAuthKeyChain.m:142)
3  ABCDE                          0x1078606ec -[FIRInstanceIDTokenStore tokenInfoWithAuthorizedEntity:scope:] + 59 (FIRInstanceIDTokenStore.m:59)
4  ABCDE                          0x10785a8c4 -[FIRInstanceIDStore tokenInfoWithAuthorizedEntity:scope:] + 191 (FIRInstanceIDStore.m:191)
5  ABCDE                          0x10785e1e0 -[FIRInstanceIDTokenManager cachedTokenInfoWithAuthorizedEntity:scope:] + 141 (FIRInstanceIDTokenManager.m:141)
6  ABCDE                          0x10784b824 -[FIRInstanceID cachedTokenIfAvailable] + 240 (FIRInstanceID.m:240)
7  ABCDE                          0x10784b460 -[FIRInstanceID token] + 190 (FIRInstanceID.m:190)
8  ABCDE                          0x10784d020 __34-[FIRInstanceID getIDWithHandler:]_block_invoke_3 + 490 (FIRInstanceID.m:490)
9  libdispatch.dylib              0x1b8879610 _dispatch_call_block_and_release + 24
10 libdispatch.dylib              0x1b887a184 _dispatch_client_callout + 16
11 libdispatch.dylib              0x1b8853b7c _dispatch_queue_override_invoke + 668
12 libdispatch.dylib              0x1b8860110 _dispatch_root_queue_drain + 344
13 libdispatch.dylib              0x1b88608b0 _dispatch_worker_thread2 + 116
14 libsystem_pthread.dylib        0x1b88c9f64 _pthread_wqthread + 212
15 libsystem_pthread.dylib        0x1b88ccae0 start_wqthread + 8

--

#0. com.apple.main-thread
0  libsystem_kernel.dylib         0x1b89835f4 mach_msg_trap + 8
1  libsystem_kernel.dylib         0x1b8982a60 mach_msg + 72
2  CoreFoundation                 0x1b8b2a068 __CFRunLoopServiceMachPort + 216
3  CoreFoundation                 0x1b8b25188 __CFRunLoopRun + 1444
4  CoreFoundation                 0x1b8b248bc CFRunLoopRunSpecific + 464
5  GraphicsServices               0x1c2990328 GSEventRunModal + 104
6  UIKitCore                      0x1bcbba6d4 UIApplicationMain + 1936
7  ABCDE                          0x10464527c main + 16 (main.m:16)
8  libdyld.dylib                  0x1b89af460 start + 4

#1. Thread
0  libsystem_kernel.dylib         0x1b89a5a74 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1b88c9ff0 _pthread_wqthread + 352
2  libsystem_pthread.dylib        0x1b88ccae0 start_wqthread + 8

#2. Thread
0  libsystem_kernel.dylib         0x1b89a5a74 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1b88c9ff0 _pthread_wqthread + 352
2  libsystem_pthread.dylib        0x1b88ccae0 start_wqthread + 8

#3. Thread
0  libsystem_kernel.dylib         0x1b89a5a74 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1b88c9ff0 _pthread_wqthread + 352
2  libsystem_pthread.dylib        0x1b88ccae0 start_wqthread + 8

#4. Thread
0  libsystem_kernel.dylib         0x1b89a5a74 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1b88c9ff0 _pthread_wqthread + 352
2  libsystem_pthread.dylib        0x1b88ccae0 start_wqthread + 8

#5. com.apple.uikit.eventfetch-thread
0  libsystem_kernel.dylib         0x1b89835f4 mach_msg_trap + 8
1  libsystem_kernel.dylib         0x1b8982a60 mach_msg + 72
2  CoreFoundation                 0x1b8b2a068 __CFRunLoopServiceMachPort + 216
3  CoreFoundation                 0x1b8b25188 __CFRunLoopRun + 1444
4  CoreFoundation                 0x1b8b248bc CFRunLoopRunSpecific + 464
5  Foundation                     0x1b8e64994 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 228
6  Foundation                     0x1b8e64874 -[NSRunLoop(NSRunLoop) runUntilDate:] + 88
7  UIKitCore                      0x1bcc5249c -[UIEventFetcher threadMain] + 152
8  Foundation                     0x1b8f950b0 __NSThread__start__ + 848
9  libsystem_pthread.dylib        0x1b88c91ec _pthread_start + 124
10 libsystem_pthread.dylib        0x1b88ccaec thread_start + 8

#6. Thread
0  libsystem_kernel.dylib         0x1b89a5a74 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1b88c9ff0 _pthread_wqthread + 352
2  libsystem_pthread.dylib        0x1b88ccae0 start_wqthread + 8

#7. Thread
0  libsystem_pthread.dylib        0x1b88ccad8 start_wqthread + 190

#8. Thread
0  libsystem_kernel.dylib         0x1b89a5a74 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1b88c9ff0 _pthread_wqthread + 352
2  libsystem_pthread.dylib        0x1b88ccae0 start_wqthread + 8

#9. Thread
0  libsystem_kernel.dylib         0x1b89a5a74 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1b88c9ff0 _pthread_wqthread + 352
2  libsystem_pthread.dylib        0x1b88ccae0 start_wqthread + 8

#10. Thread
0  libsystem_kernel.dylib         0x1b89a5a74 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1b88c9ff0 _pthread_wqthread + 352
2  libsystem_pthread.dylib        0x1b88ccae0 start_wqthread + 8

#11. GAIThread
0  libsystem_kernel.dylib         0x1b89835f4 mach_msg_trap + 8
1  libsystem_kernel.dylib         0x1b8982a60 mach_msg + 72
2  CoreFoundation                 0x1b8b2a068 __CFRunLoopServiceMachPort + 216
3  CoreFoundation                 0x1b8b25188 __CFRunLoopRun + 1444
4  CoreFoundation                 0x1b8b248bc CFRunLoopRunSpecific + 464
5  Foundation                     0x1b8e64994 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 228
6  Foundation                     0x1b8e9e4a8 -[NSRunLoop(NSRunLoop) run] + 88
7  ABCDE                          0x10758fe88 +[GAI threadMain:] + 4354588296
8  Foundation                     0x1b8f950b0 __NSThread__start__ + 848
9  libsystem_pthread.dylib        0x1b88c91ec _pthread_start + 124
10 libsystem_pthread.dylib        0x1b88ccaec thread_start + 8

#12. com.twitter.crashlytics.ios.MachExceptionServer
0  ABCDE                          0x107742744 CLSProcessRecordAllThreads + 4356368196
1  ABCDE                          0x107742b2c CLSProcessRecordAllThreads + 4356369196
2  ABCDE                          0x1077323b4 CLSHandler + 4356301748
3  ABCDE                          0x10772d794 CLSMachExceptionServer + 4356282260
4  libsystem_pthread.dylib        0x1b88c91ec _pthread_start + 124
5  libsystem_pthread.dylib        0x1b88ccaec thread_start + 8

#13. com.apple.NSURLConnectionLoader
0  libsystem_kernel.dylib         0x1b89835f4 mach_msg_trap + 8
1  libsystem_kernel.dylib         0x1b8982a60 mach_msg + 72
2  CoreFoundation                 0x1b8b2a068 __CFRunLoopServiceMachPort + 216
3  CoreFoundation                 0x1b8b25188 __CFRunLoopRun + 1444
4  CoreFoundation                 0x1b8b248bc CFRunLoopRunSpecific + 464
5  CFNetwork                      0x1bbd9fe68 (Missing)
6  Foundation                     0x1b8f950b0 __NSThread__start__ + 848
7  libsystem_pthread.dylib        0x1b88c91ec _pthread_start + 124
8  libsystem_pthread.dylib        0x1b88ccaec thread_start + 8

#14. Thread
0  libsystem_kernel.dylib         0x1b89a5a74 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1b88c9ff0 _pthread_wqthread + 352
2  libsystem_pthread.dylib        0x1b88ccae0 start_wqthread + 8

#15. Thread
0  libsystem_kernel.dylib         0x1b89a5a74 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1b88c9ff0 _pthread_wqthread + 352
2  libsystem_pthread.dylib        0x1b88ccae0 start_wqthread + 8

#16. Thread
0  libsystem_kernel.dylib         0x1b89a5a74 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1b88c9ff0 _pthread_wqthread + 352
2  libsystem_pthread.dylib        0x1b88ccae0 start_wqthread + 8

#17. Thread
0  libsystem_kernel.dylib         0x1b89a5a74 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1b88c9ff0 _pthread_wqthread + 352
2  libsystem_pthread.dylib        0x1b88ccae0 start_wqthread + 8

#18. Thread
0  libsystem_kernel.dylib         0x1b89a5a74 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1b88c9ff0 _pthread_wqthread + 352
2  libsystem_pthread.dylib        0x1b88ccae0 start_wqthread + 8

#19. Thread
0  libsystem_kernel.dylib         0x1b89a5a74 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1b88c9ff0 _pthread_wqthread + 352
2  libsystem_pthread.dylib        0x1b88ccae0 start_wqthread + 8

#20. Thread
0  libsystem_kernel.dylib         0x1b89a5a74 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1b88c9ff0 _pthread_wqthread + 352
2  libsystem_pthread.dylib        0x1b88ccae0 start_wqthread + 8

#21. Crashed: com.apple.root.default-qos
0  libobjc.A.dylib                0x1b88ef06c objc_retain + 76
1  ABCDE                          0x107850d44 -[FIRInstanceIDAuthKeychain itemsMatchingService:account:] + 79 (FIRInstanceIDAuthKeyChain.m:79)
2  ABCDE                          0x107851360 -[FIRInstanceIDAuthKeychain dataForService:account:] + 142 (FIRInstanceIDAuthKeyChain.m:142)
3  ABCDE                          0x1078606ec -[FIRInstanceIDTokenStore tokenInfoWithAuthorizedEntity:scope:] + 59 (FIRInstanceIDTokenStore.m:59)
4  ABCDE                          0x10785a8c4 -[FIRInstanceIDStore tokenInfoWithAuthorizedEntity:scope:] + 191 (FIRInstanceIDStore.m:191)
5  ABCDE                          0x10785e1e0 -[FIRInstanceIDTokenManager cachedTokenInfoWithAuthorizedEntity:scope:] + 141 (FIRInstanceIDTokenManager.m:141)
6  ABCDE                          0x10784b824 -[FIRInstanceID cachedTokenIfAvailable] + 240 (FIRInstanceID.m:240)
7  ABCDE                          0x10784b460 -[FIRInstanceID token] + 190 (FIRInstanceID.m:190)
8  ABCDE                          0x10784d020 __34-[FIRInstanceID getIDWithHandler:]_block_invoke_3 + 490 (FIRInstanceID.m:490)
9  libdispatch.dylib              0x1b8879610 _dispatch_call_block_and_release + 24
10 libdispatch.dylib              0x1b887a184 _dispatch_client_callout + 16
11 libdispatch.dylib              0x1b8853b7c _dispatch_queue_override_invoke + 668
12 libdispatch.dylib              0x1b8860110 _dispatch_root_queue_drain + 344
13 libdispatch.dylib              0x1b88608b0 _dispatch_worker_thread2 + 116
14 libsystem_pthread.dylib        0x1b88c9f64 _pthread_wqthread + 212
15 libsystem_pthread.dylib        0x1b88ccae0 start_wqthread + 8

#22. Thread
0  libsystem_kernel.dylib         0x1b89a5a74 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1b88c9ff0 _pthread_wqthread + 352
2  libsystem_pthread.dylib        0x1b88ccae0 start_wqthread + 8

#23. Thread
0  libsystem_kernel.dylib         0x1b89a5a74 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1b88c9ff0 _pthread_wqthread + 352
2  libsystem_pthread.dylib        0x1b88ccae0 start_wqthread + 8

#24. Thread
0  libsystem_kernel.dylib         0x1b89a5a74 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1b88c9ff0 _pthread_wqthread + 352
2  libsystem_pthread.dylib        0x1b88ccae0 start_wqthread + 8

#25. Thread
0  libsystem_pthread.dylib        0x1b88ccad8 start_wqthread + 190

#26. Thread
0  libsystem_kernel.dylib         0x1b89a5a74 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1b88c9ff0 _pthread_wqthread + 352
2  libsystem_pthread.dylib        0x1b88ccae0 start_wqthread + 8

#27. Thread
0  libsystem_kernel.dylib         0x1b89a5a74 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1b88c9ff0 _pthread_wqthread + 352
2  libsystem_pthread.dylib        0x1b88ccae0 start_wqthread + 8

#28. Thread
0  libsystem_kernel.dylib         0x1b89a5a74 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1b88c9ff0 _pthread_wqthread + 352
2  libsystem_pthread.dylib        0x1b88ccae0 start_wqthread + 8

#29. Thread
0  libsystem_kernel.dylib         0x1b89a5a74 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x1b88c9ff0 _pthread_wqthread + 352
2  libsystem_pthread.dylib        0x1b88ccae0 start_wqthread + 8

#30. JavaScriptCore bmalloc scavenger
0  libsystem_kernel.dylib         0x1b89a4c8c __psynch_cvwait + 8
1  libsystem_pthread.dylib        0x1b88c64e0 _pthread_cond_wait$VARIANT$armv81 + 676
2  libc++.1.dylib                 0x1b89f6840 std::__1::condition_variable::__do_timed_wait(std::__1::unique_lock<std::__1::mutex>&, std::__1::chrono::time_point<std::__1::chrono::system_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > >) + 96
3  JavaScriptCore                 0x1c7787044 std::__1::cv_status std::__1::condition_variable_any::wait_until<std::__1::unique_lock<bmalloc::Mutex>, std::__1::chrono::steady_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > >(std::__1::unique_lock<bmalloc::Mutex>&, std::__1::chrono::time_point<std::__1::chrono::steady_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > > const&) + 208
4  JavaScriptCore                 0x1c7785e3c bmalloc::Scavenger::threadRunLoop() + 312
5  JavaScriptCore                 0x1c7785ab4 bmalloc::Scavenger::Scavenger(std::__1::lock_guard<bmalloc::Mutex>&) + 10
6  JavaScriptCore                 0x1c7786dc0 std::__1::__thread_specific_ptr<std::__1::__thread_struct>::set_pointer(std::__1::__thread_struct*) + 38
7  libsystem_pthread.dylib        0x1b88c91ec _pthread_start + 124
8  libsystem_pthread.dylib        0x1b88ccaec thread_start + 8

@charlotteliang
Copy link
Contributor

charlotteliang commented Dec 9, 2019

@Decsunshine @skuske Can you also share the crash error that normally showing at the top?
We want to see if it's security framework or sth else.

@skuske
Copy link
Author

skuske commented Dec 10, 2019

@chliangGoogle

Sure, here it is:

Crashed: com.google.GoogleConfigService.FIRRemoteConfig
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000010

Hope that helps. :o)

@visumickey visumickey removed their assignment Dec 10, 2019
@charlotteliang
Copy link
Contributor

@skuske This seems like it's crashing on a remote config serial queue. (com.google.GoogleConfigService.FIRRemoteConfig is its id). I wonder if this is two different issues, can you file a different one on remote config case and assign to @dmandar.
Can you share the error when it crash on FIRInstanceIDAuthKeychain on this thread?

@skuske
Copy link
Author

skuske commented Dec 11, 2019

@chliangGoogle

Sorry, I don't understand. I actually shared the error when it crashes on FIRInstanceIDAuthKeychain:

crash

@charlotteliang
Copy link
Contributor

Seems like it happens with remote config trigger IID call that it's crashing on remote config thread. Will take a look at. Thanks!

@greenzeal
Copy link

greenzeal commented Dec 13, 2019

Some more stack trace

Thread 0
#0	(null) in objc_msgSend ()
#1	0x0000000104eecbd4 in -[FIRInstanceIDKeyPairStore migrateKeyPairCacheIfNeededWithHandler:]
#2	0x0000000104eebf3c in -[FIRInstanceIDKeyPairStore invalidateKeyPairsIfNeeded]
#3	0x0000000104ee2770 in -[FIRInstanceID setupKeyPairManager]
#4	0x0000000104ee2690 in -[FIRInstanceID start]
#5	0x0000000104ee1f54 in __37+[FIRInstanceID componentsToRegister]_block_invoke
#6	0x0000000104ed16b4 in -[FIRComponentContainer instantiateInstanceForProtocol:withBlock:]
#7	0x0000000104ed186c in -[FIRComponentContainer instanceForProtocol:]
#8	0x0000000104ed1b40 in +[FIRComponentType instanceForProtocol:inContainer:]
#9	0x0000000104edf0f8 in +[FIRInstanceID instanceID]
#10	0x0000000104ee1fa4 in +[FIRInstanceID configureWithApp:]
#11	0x0000000104ecedf0 in +[FIRApp sendNotificationsToSDKs:]
#12	0x0000000104ecde6c in +[FIRApp configureWithName:options:]
#13	0x0000000104ecdae4 in +[FIRApp configureWithOptions:]
#14	0x0000000104ecda44 in +[FIRApp configure]
#15	0x0000000104e80bac in -[AppDelegate application:didFinishLaunchingWithOptions:]


**Thread 1**
#0	(null) in mach_msg_trap ()
#1	(null) in mach_msg ()
#2	(null) in _dispatch_mach_send_and_wait_for_reply ()
#3	(null) in dispatch_mach_send_with_result_and_wait_for_reply$VARIANT$mp ()
#4	(null) in xpc_connection_send_message_with_reply_sync ()
#5	(null) in __99-[CFPrefsPlistSource sendFullyPreparedMessage:toConnection:settingValues:forKeys:count:retryC... ()
#6	(null) in -[_CFXPreferences withConnectionForRole:performBlock:] ()
#7	(null) in -[CFPrefsPlistSource sendFullyPreparedMessage:toConnection:settingValues:forKeys:count:retryCount:] ()
#8	(null) in -[CFPrefsPlistSource sendMessageSettingValues:forKeys:count:] ()
#9	(null) in -[CFPrefsPlistSource alreadylocked_setPrecopiedValues:forKeys:count:from:] ()
#10	(null) in -[CFPrefsSource setValues:forKeys:count:copyValues:removeValuesForKeys:count:from:] ()
#11	(null) in -[CFPrefsSource setValues:forKeys:count:copyValues:from:] ()
#12	(null) in -[CFPrefsSearchListSource alreadylocked_setPrecopiedValues:forKeys:count:from:] ()
#13	(null) in -[CFPrefsSource setValues:forKeys:count:copyValues:removeValuesForKeys:count:from:] ()
#14	(null) in -[CFPrefsSource setValues:forKeys:count:copyValues:from:] ()
#15	(null) in -[CFPrefsSource setValue:forKey:from:] ()
#16	(null) in __76-[_CFXPreferences setValue:forKey:appIdentifier:container:configurationURL:]_block_invoke ()
#17	(null) in __108-[_CFXPreferences(SearchListAdditions) withSearchListForIdentifier:container:cloudConfigurat... ()
#18	(null) in normalizeQuintuplet ()
#19	(null) in -[_CFXPreferences(SearchListAdditions) withSearchListForIdentifier:container:cloudConfigurationUR... ()
#20	(null) in -[_CFXPreferences setValue:forKey:appIdentifier:container:configurationURL:] ()
#21	(null) in _CFPreferencesSetAppValueWithContainerAndConfiguration ()
#22	(null) in -[APMUserDefaults setObject:forKey:] ()
#23	(null) in _dispatch_client_callout ()
#24	(null) in _dispatch_lane_barrier_sync_invoke_and_complete ()
#25	(null) in -[APMPersistedConfig setLoadTimestampValue:] ()
#26	(null) in -[APMMeasurement initWithDatabaseName:persistedConfig:network:scheduler:alarm:appID:isAnalyticsCo... ()
#27	(null) in -[APMMeasurement initWithAppID:isAnalyticsCollectionEnabled:isAnalyticsCollectionDeactivated:safe... ()
#28	(null) in +[APMMeasurement initializeSharedInstanceWithAppID:isAnalyticsCollectionEnabled:isAnalyticsCollec... ()
#29	(null) in __46+[APMAnalytics startWithAppID:origin:options:]_block_invoke_2 ()
#30	(null) in _dispatch_call_block_and_release ()
#31	(null) in _dispatch_client_callout ()
#32	(null) in _dispatch_lane_serial_drain$VARIANT$mp ()
#33	(null) in _dispatch_lane_invoke$VARIANT$mp ()
#34	(null) in _dispatch_workloop_worker_thread ()
#35	(null) in _pthread_wqthread ()
#36	(null) in start_wqthread ()

@ryanwilson ryanwilson removed their assignment Jan 22, 2020
@charlotteliang
Copy link
Contributor

@skuske Can you share with us the code on how you call remote config?

@skuske
Copy link
Author

skuske commented Feb 12, 2020

@chliangGoogle

Sure, as far as I can tell I do it exactly as per the instructions (https://firebase.google.com/docs/remote-config/use-config-ios?authuser=0):

However, it seems that the issue disappeared with one of the newer releases of the SDK as I haven't seen this issue for a few weeks now.

    FIRRemoteConfig *objRemoteConfig = [FIRRemoteConfig remoteConfig];

#if DEBUG
    FIRRemoteConfigSettings *remoteConfigSettings = [[FIRRemoteConfigSettings alloc] init];
    remoteConfigSettings.minimumFetchInterval = 0;
    objRemoteConfig.configSettings = remoteConfigSettings;
#endif

    [objRemoteConfig setDefaultsFromPlistFileName:@"RemoteConfigDefaults"];

    [objRemoteConfig fetchWithExpirationDuration:1800 completionHandler:^(FIRRemoteConfigFetchStatus status, NSError *error) {
        if (status == FIRRemoteConfigFetchStatusSuccess)
        {
            NSLog(@"Config fetched!");
            [objRemoteConfig activateWithCompletionHandler:^(NSError * _Nullable error) {
                // Non related code here
            }];
        } else {            
            NSLog(@"Config not fetched");
            NSLog(@"Error %@", error.localizedDescription);
        }
        
    }];

@morganchen12
Copy link
Contributor

Thanks for the update @skuske. I'll set this issue to auto-close after a week or so if the issue doesn't reappear. If it does or if it regresses in the future, please leave a comment and we'll re-open the issue.

@skuske
Copy link
Author

skuske commented Feb 12, 2020

@morganchen12

Will do. Thanks! 🙂

@google-oss-bot
Copy link

Hey @skuske. 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
Copy link

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

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

@firebase firebase locked and limited conversation to collaborators Mar 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests