UIKIt crash

I'm getting a crash report from our custom keyboard extension that involves UIKit. [_UIViewServiceViewControllerOperator __createViewController:withContextToken... Can someone see what's going on in this report? Perhaps someone that know what's at (UIViewServiceViewControllerOperator.m:2893) , thanks!

Here is the full stack:

Distributor ID:      com.apple.AppStore
Hardware Model:      iPhone12,1
Process:             MyKBIntl [11 728]
Path:                /private/var/containers/Bundle/Application/0405842D-F6FD-41DD-AF1C-A3F9339F604D/***
Identifier:          com.***.MyIntl.MyKBIntl
Version:             4.32.1 (984)
AppVariant:          1:iPhone12,1:15
Code Type:           ARM-64 (Native)
Role:                Background
Parent Process:      launchd [1]
Coalition:           com.***.MyIntl.MyKBIntl [2439]
Date/Time:           2024-07-24 01:29:22.7850 +0700
Launch Time:         2024-07-24 01:29:21.9843 +0700
OS Version:          iPhone OS 17.5.1 (21F90)
Release Type:        User
Baseband Version:    5.00.00
Report Version:      104
Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Termination Reason: SIGNAL 6 Abort trap: 6
Terminating Process: MyKBIntl [11728]
Triggered by Thread:  0
Last Exception Backtrace:
0   CoreFoundation                	0x19508cf20 __exceptionPreprocess + 164 (NSException.m:249)
1   libobjc.A.dylib               	0x18cf42018 objc_exception_throw + 60 (objc-exception.mm:356)
2   CoreFoundation                	0x19518b6dc +[NSException raise:format:] + 112 (NSException.m:0)
3   UIKitCore                     	0x197d9c9cc -[_UIAppearanceRecorder _applyCustomizations] + 2376 (UIAppearance.m:2642)
4   UIKitCore                     	0x1984a38a8 UIViewServiceUpdateAppearanceWithSerializedRepresentations + 288 (UIViewServiceAppearance.m:50)
5   UIKitCore                     	0x198498acc -[_UIViewServiceViewControllerOperator __createViewControllerWithOptions:completionBlock:] + 5116 (UIViewServiceViewControllerOperator.m:2893)
6   CoreFoundation                	0x195029814 __invoking___ + 148 (:-1)
7   CoreFoundation                	0x195028860 -[NSInvocation invoke] + 428 (NSForwarding.m:3411)
8   CoreFoundation                	0x19509f1dc -[NSInvocation invokeWithTarget:] + 64 (NSForwarding.m:3508)
9   UIKitCore                     	0x1984a7170 -[_UIViewServiceImplicitAnimationDecodingProxy forwardInvocation:] + 136 (UIViewServiceImplicitAnimationCoding.m:76)
10  CoreFoundation                	0x195029d60 ___forwarding___ + 976 (NSForwarding.m:3654)
11  CoreFoundation                	0x1950298d0 _CF_forwarding_prep_0 + 96 (:-1)
12  CoreFoundation                	0x195029814 __invoking___ + 148 (:-1)
13  CoreFoundation                	0x195028860 -[NSInvocation invoke] + 428 (NSForwarding.m:3411)
14  CoreFoundation                	0x19509f1dc -[NSInvocation invokeWithTarget:] + 64 (NSForwarding.m:3508)
15  UIKitCore                     	0x198487c58 -[_UIQueueingProxy forwardInvocation:] + 308 (UIQueueingProxy.m:57)
16  CoreFoundation                	0x195029d60 ___forwarding___ + 976 (NSForwarding.m:3654)
17  CoreFoundation                	0x1950298d0 _CF_forwarding_prep_0 + 96 (:-1)
18  CoreFoundation                	0x195029814 __invoking___ + 148 (:-1)
19  CoreFoundation                	0x195028860 -[NSInvocation invoke] + 428 (NSForwarding.m:3411)
20  CoreFoundation                	0x19509f1dc -[NSInvocation invokeWithTarget:] + 64 (NSForwarding.m:3508)
21  CoreFoundation                	0x195029d60 ___forwarding___ + 976 (NSForwarding.m:3654)
22  CoreFoundation                	0x1950298d0 _CF_forwarding_prep_0 + 96 (:-1)
23  CoreFoundation                	0x195029814 __invoking___ + 148 (:-1)
24  CoreFoundation                	0x195028860 -[NSInvocation invoke] + 428 (NSForwarding.m:3411)
25  libdispatch.dylib             	0x19cf31dd4 _dispatch_client_callout + 20 (object.m:576)
26  libdispatch.dylib             	0x19cf3586c _dispatch_block_invoke_direct + 288 (queue.c:511)
27  FrontBoardServices            	0x1add06d58 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 52 (FBSSerialQueue.m:285)
28  FrontBoardServices            	0x1add06cd8 -[FBSMainRunLoopSerialQueue _targetQueue_performNextIfPossible] + 240 (FBSSerialQueue.m:309)
29  FrontBoardServices            	0x1add06bb0 -[FBSMainRunLoopSerialQueue _performNextFromRunLoopSource] + 28 (FBSSerialQueue.m:322)
30  CoreFoundation                	0x19505f834 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28 (CFRunLoop.c:1957)
31  CoreFoundation                	0x19505f7c8 __CFRunLoopDoSource0 + 176 (CFRunLoop.c:2001)
32  CoreFoundation                	0x19505d298 __CFRunLoopDoSources0 + 244 (CFRunLoop.c:2038)
33  CoreFoundation                	0x19505c484 __CFRunLoopRun + 828 (CFRunLoop.c:2955)
34  CoreFoundation                	0x19505bcd8 CFRunLoopRunSpecific + 608 (CFRunLoop.c:3420)
35  GraphicsServices              	0x1d9f0c1a8 GSEventRunModal + 164 (GSEvent.c:2196)
36  UIKitCore                     	0x19769490c -[UIApplication _run] + 888 (UIApplication.m:3713)
37  UIKitCore                     	0x1977489d0 UIApplicationMain + 340 (UIApplication.m:5303)
38  libxpc.dylib                  	0x1f1f3f2c4 _xpc_objc_uimain + 224 (main.m:188)
39  libxpc.dylib                  	0x1f1f3f0c0 _xpc_objc_main + 108 (main.m:222)
40  libxpc.dylib                  	0x1f1f4171c _xpc_main + 64 (init.c:1294)
41  libxpc.dylib                  	0x1f1f418fc xpc_main + 64 (init.c:1377)
42  Foundation                    	0x19403640c -[NSXPCListener resume] + 312 (NSXPCListener.m:471)
43  PlugInKit                     	0x1c1389e68 -[PKService runUsingServiceListener:] + 364 (PKService.m:219)
44  PlugInKit                     	0x1c1389cf4 -[PKService run] + 20 (PKService.m:185)
45  PlugInKit                     	0x1c13899b0 +[PKService main] + 524 (PKService.m:126)
46  PlugInKit                     	0x1c138a1c4 +[PKService _defaultRun:arguments:] + 16 (PKService.m:265)
47  ExtensionFoundation           	0x1a40bdbf0 EXExtensionMain + 288 (EXExtensionMain.m:0)
48  Foundation                    	0x1940c280c NSExtensionMain + 204 (NSExtensionMain.m:21)
49  dyld                          	0x1b870de4c start + 2240 (dyldMain.cpp:1298)

  // Here too long is truncated, you can see the full stack
EOF

The following frames show that the crash happend because UIKit raised an exception when trying to apply UIAppearance customizations, which was likely because the customization dictionary had unexpected data.

3 UIKitCore 0x197d9c9cc -[_UIAppearanceRecorder _applyCustomizations] + 2376 (UIAppearance.m:2642)

4 UIKitCore 0x1984a38a8 UIViewServiceUpdateAppearanceWithSerializedRepresentations + 288 (UIViewServiceAppearance.m:50)

The crash report doesn't unveil where the unexpected data was from, and so I can't go further by reading the report.

It doesn't look like that the unexpected data was from the keyboard extension, but to completely rule out the possibility, you can try to comment out your code or Info.plist entry that's related to UIAppearance, if any, to see if that changes anything.

Other than that, I'd suggest that you file a feedback report for the UIKit folks to investigate. If you do so, please share your report ID here for folks to track.

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

UIKIt crash
 
 
Q