The crash was originally reported here. See here for context.
Versions 7.36.0 and higher crash in dispatch_once when initializing a singleton.
Crashed: com.apple.root.default-qos
0 libdispatch.dylib 0x1c31112c8 _dispatch_once_wait$VARIANT$armv81 + 208
1 KeepSafe 0x103729d4c +[GADNSettings sharedInstance] (once.h:85)
2 KeepSafe 0x103691f80 -[GADNEventLogger init] (GADNEventLogger.m:100)
3 KeepSafe 0x103691e34 __33+[GADNEventLogger sharedInstance]_block_invoke (GADNEventLogger.m:85)
4 libdispatch.dylib 0x1c3142484 _dispatch_client_callout + 16
5 libdispatch.dylib 0x1c3112234 _dispatch_once_callout + 28
6 KeepSafe 0x103691e04 +[GADNEventLogger sharedInstance] (once.h:85)
7 KeepSafe 0x10367f090 GADNPostErrorEvent (GADNLogger.m:14)
8 KeepSafe 0x10372a18c -[GADNSettings openDatabase] (GADNSettings.m:143)
9 KeepSafe 0x103729eec -[GADNSettings init] (GADNSettings.m:71)
10 KeepSafe 0x103729d7c __30+[GADNSettings sharedInstance]_block_invoke (GADNSettings.m:54)
11 libdispatch.dylib 0x1c3142484 _dispatch_client_callout + 16
12 libdispatch.dylib 0x1c3112234 _dispatch_once_callout + 28
13 KeepSafe 0x103729d4c +[GADNSettings sharedInstance] (once.h:85)
14 KeepSafe 0x103703d00 __69-[GADNApplication runBackgroundEarlyActivitiesWithCompletionHandler:]_block_invoke (GADNApplication.m:260)
15 libdispatch.dylib 0x1c31416c8 _dispatch_call_block_and_release + 24
16 libdispatch.dylib 0x1c3142484 _dispatch_client_callout + 16
17 libdispatch.dylib 0x1c3118a6c _dispatch_queue_override_invoke + 664
18 libdispatch.dylib 0x1c3124aec _dispatch_root_queue_drain + 344
19 libdispatch.dylib 0x1c312534c _dispatch_worker_thread2 + 116
20 libsystem_pthread.dylib 0x1c332517c _pthread_wqthread + 472
21 libsystem_pthread.dylib 0x1c3327cec start_wqthread + 4
The implementation of +[GADNSettings sharedInstance] isn't unusual, so this crash must have some other obtuse reason.
+ (nonnull GADNSettings *)sharedInstance {
static dispatch_once_t onceToken;
static GADNSettings *sharedInstance;
dispatch_once(&onceToken, ^{
sharedInstance = [[GADNSettings alloc] init];
});
return sharedInstance;
}
Thanks @morganchen12 ! I sent the forum member the complete stack trace if it helps. I can also email it to you but it contains private APIs so I'd rather not share it publicly.
No need to email me for the time being; we'll forward this issue to the team internally and see how they respond.
Thanks for everything! Keep us posted. :)
Filed internally at b/124126325
Ah, I think I found the issue. The implementation of +[GADNSettings sharedInstance] is accidentally recursive, which you can see in the stack trace since it shows up twice.
This recursion causes deadlock, which causes your app to be killed in the wild but not when a debugger is attached.
@BranchS and @rob-keepsafe, the admob team tells me this is fixed in 7.37 and above. Can both of you try updating your pods and seeing if this issue still occurs in the latest release?
Thanks for the update and for being so proactive about this @morganchen12 ! We're a little gunshy to test out 7.37 since we had to hotfix our last release, but I'll report back once we cross that bridge (feel free to close this for now).
鉁嶏笍 As a point of feedback, the release notes for the admob team aren't very transparent so if the crash was indeed fixed in that release and they had stated so, I wouldn't have had to bug you with opening this issue. So please ask them to help us reduce the noise by being more explicit 馃檹
Closing for now, please comment again here if this regresses.
Thanks all!
Most helpful comment
No need to email me for the time being; we'll forward this issue to the team internally and see how they respond.