Note the 0xd00d2bad
(‘dude, too bad’) exception code. That’s discussed (in very vague terms) in this doc. I’ll try to expand on that here, but be warned that it’s impossible to discuss this without getting deep into iOS implementation details. This stuff changes regularly, so don’t ship code that depends on any of the following.
First, I want to define the term assertion. In this context, I’m using it per the definition in UIApplication Background Task Notes.
Second, I want to talk about runningboardd
. This is actually present on macOS as well, and there we have man pages! The runningboardd
man page says:
runningboardd
is a daemon that manages process assertions to ensure those processes are kept in the appropriate state while assertions are in effect.
As you can see, it’s using assertion in the same way I am (-:
The ‘dude, too bad’ crash indicates that runningboardd
has killed your process because it’s using too many assertions. The tricky thing about this, and the reason why the above-mentioned doc is so vague, is that there isn’t a one-to-one correlation between APIs called by you and the number of assertions taken out by the system frameworks. It is, as is often the case, complicated.
Having said that, it’s likely that WebKit is involved. Consider this backtrace:
Thread 7 name:
Thread 7:
0 libobjc.A.dylib … objc_msgSend + 40 (:-1)
1 Foundation … -[NSString(NSCFAdditions) _encodingCantBeStoredInEightBitCFString] + 20 (NSCFString.…
2 CoreFoundation … CFStringAppend + 376 (CFString.c:5930)
3 CoreFoundation … __CFStringAppendFormatCore + 10964 (CFString.c:9187)
4 CoreFoundation … _CFStringCreateWithFormatAndArgumentsReturningMetadata + 184 (CFString.c:2030)
5 CoreFoundation … _CFStringCreateWithFormatAndArgumentsAux2 + 44 (CFString.c:2022)
6 Foundation … -[NSString initWithFormat:] + 52 (NSString.m:1974)
7 RunningBoardServices … -[RBSAssertionDescriptor description] + 112 (RBSAssertionDescriptor.m:77)
8 Foundation … _NS_os_log_callback + 284 (NSPlatform.m:206)
9 libsystem_trace.dylib … _os_log_fmt_flatten_NSCF + 64 (format.m:60)
10 libsystem_trace.dylib … _os_log_fmt_flatten_object + 220 (format.m:322)
11 libsystem_trace.dylib … _os_log_impl_flatten_and_send + 1864 (log.c:2672)
12 libsystem_trace.dylib … _os_log + 168 (log.c:2783)
13 libsystem_trace.dylib … _os_log_impl + 28 (log.c:2801)
14 RunningBoardServices … -[RBSConnection acquireAssertion:error:] + 160 (RBSConnection.m:277)
15 RunningBoardServices … -[RBSAssertion acquireWithError:] + 176 (RBSAssertion.m:93)
16 ServiceExtensions … specialized static _Capability.acquireAssertion(process:environmentIdentifier:attrib…
17 ServiceExtensions … _Capability.AssertionCapability.grant(to:) + 328 (Capabilities.swift:283)
18 ServiceExtensions … specialized _ExtensionProcess.grant(capabilities:) + 592 (:-1)
19 ServiceExtensions … protocol witness for _ExtensionProcess.grant(capability:) in conformance _ContentPro…
20 ServiceExtensions … _SEExtensionProcess.grant(capabilities:) + 204 (:-1)
21 ServiceExtensions … _SEExtensionProcess.grant(capability:) + 16 (:-1)
22 ServiceExtensions … @objc _SEExtensionProcess.grant(capabilities:) + 76 (:-1)
23 WebKit … WebKit::ProcessAssertion::acquireSync() + 300 (ProcessAssertionCocoa.mm:475)
24 WebKit … WTF::Detail::CallableWrapper<WebKit::ProcessAssertion::acquireAsync(WTF::CompletionH…
25 JavaScriptCore … void WTF::dispatchWorkItem<WTF::(anonymous namespace)::DispatchWorkItem>(void*) + 60…
26 libdispatch.dylib … _dispatch_client_callout + 20 (object.m:576)
27 libdispatch.dylib … _dispatch_lane_serial_drain + 748 (queue.c:3900)
28 libdispatch.dylib … _dispatch_lane_invoke + 380 (queue.c:3991)
29 libdispatch.dylib … _dispatch_root_queue_drain_deferred_wlh + 288 (queue.c:6998)
30 libdispatch.dylib … _dispatch_workloop_worker_thread + 404 (queue.c:6592)
31 libsystem_pthread.dyli… _pthread_wqthread + 288 (pthread.c:2665)
32 libsystem_pthread.dyli… start_wqthread + 8 (:-1)
You can see stuff related to runningboardd
in frames 7, 14, and 15, and stuff related to WebKit in a bunch of other frames.
Now, that does not mean that WebKit is at fault. It could be that some other code put your app into this state and WebKit just happened to be the one that noticed.
Coming back to that graph you posted, I presume that your seeing this crash disparity between OS releases that are all running the same version of your app? If so, I think the next step is for you to file a bug about this.
If you have access to a device that crashed in this way, make sure to include a sysdiagnose log from it.
Please post your bug number, just for the record.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"