iMessage App crashes simulator in compact mode with soft keyboard showing up

Hi,


I have a small iMessage App which has a serach bar text field at the top. When the App is in comapct mode and I click into the search bar the whole simulator crashes with some inconsistency exception. I know there shouldn't be a search bar in compact mode and I plan to look for a other solution but why is it crashing the simulator?


Here is the stacktrace:


Version: 5.0 (1.0)
Code Type: X86-64 (Native)
Parent Process: launchd_sim [45975]
Responsible: MobileSMS [48437]
User ID: 501

Date/Time: 2017-03-30 08:26:37.122 +0200
OS Version: Mac OS X 10.12.3 (16D32)
Report Version: 12
Anonymous UUID: 620CA4B7-419B-E0D7-66BB-C939C1A35636

Sleep/Wake UUID: 041E6CB4-6F3C-4F4E-995F-9722AD0324BB

Time Awake Since Boot: 140000 seconds
Time Since Wake: 7400 seconds

System Integrity Protection: enabled

Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY

Application Specific Information:
*** Terminating app due to uncaught exception 'UIViewControllerHierarchyInconsistency', reason: 'child view controller:<UICompatibilityInputViewController: 0x7fe4b1d52210> should have parent view controller:<CKFullScreenAppViewController: 0x7fe4b404bf30> but actual parent is:<UIInputWindowController: 0x7fe4b2045000>'
terminating with uncaught exception of type NSException
abort() called
CoreSimulator 375.20 - Device: iPhone SE - Runtime: iOS 10.3 (14E269) - DeviceType: iPhone SE


Any ideas how to prevent this?


Cheers,


Frank

I'm seeing the same problem, on iOS 10.3.1. Here's a crash log. If anyone from Apple sees this, I've filed rdar://31659350 describing the issue.



Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note:  EXC_CORPSE_NOTIFY
Triggered by Thread:  0


Application Specific Information:
abort() called


Filtered syslog:
None found


Last Exception Backtrace:
0   CoreFoundation                 0x19090efd8 __exceptionPreprocess + 124
1   libobjc.A.dylib               0x18f370538 objc_exception_throw + 56
2   CoreFoundation                 0x19090ef20 +[NSException raise:format:] + 116
3   UIKit                         0x196ab9160 -[UIView(Hierarchy) _associatedViewControllerForwardsAppearanceCallbacks:performHierarchyCheck:isRoot:] + 296
4   UIKit                         0x196a45dac -[UIView(Hierarchy) _willMoveToWindow:withAncestorView:] + 244
5   UIKit                         0x196a39204 __85-[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:withObject:copySublayers:]_block_invoke + 88
6   UIKit                         0x196a390e8 -[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:withObject:copySublayers:] + 448
7   UIKit                         0x196a45240 -[UIView(Internal) _addSubview:positioned:relativeTo:] + 456
8   UIKit                         0x196a45060 -[UIView(Hierarchy) addSubview:] + 828
9   ChatKit                       0x1a12bf844 -[CKFullScreenAppViewController animateBrowserViewFromSourceRect:interactive:switcherFooterView:completion:] + 1520
10  ChatKit                       0x1a1368a78 __100-[CKBrowserTransitionCoordinator transitionCurrentBrowserToExpandedPresentationAnimated:completion:]_block_invoke.217 + 344
11  UIKit                         0x1a50b960c __75-[UIViewControllerAccessibility presentViewController:animated:completion:]_block_invoke + 136
12  UIKit                         0x196d8b5ec -[UIPresentationController transitionDidFinish:] + 1316
13  UIKit                         0x196efca50 -[_UICurrentContextPresentationController transitionDidFinish:] + 44
14  UIKit                         0x196d8eddc __56-[UIPresentationController runTransitionForCurrentState]_block_invoke_2 + 188
15  UIKit                         0x196b62a1c -[_UIViewControllerTransitionContext completeTransition:] + 116
16  Foundation                     0x1913ebbfc __NSFireDelayedPerform + 408
17  CoreFoundation                 0x1908bda9c __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 28
18  CoreFoundation                 0x1908bd7a0 __CFRunLoopDoTimer + 856
19  CoreFoundation                 0x1908bd060 __CFRunLoopDoTimers + 244
20  CoreFoundation                 0x1908bac84 __CFRunLoopRun + 1484
21  CoreFoundation                 0x1907ead94 CFRunLoopRunSpecific + 424
22  GraphicsServices               0x192254074 GSEventRunModal + 100
23  UIKit                         0x196aa3130 UIApplicationMain + 208
24  MobileSMS                     0x1000f5894 0x1000d4000 + 137364
25  libdyld.dylib                 0x18f7f959c start + 4




Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libsystem_kernel.dylib         0x000000018f909014 __pthread_kill + 8
1   libsystem_pthread.dylib       0x000000018f9d3334 pthread_kill + 112
2   libsystem_c.dylib             0x000000018f87d9c4 abort + 140
3   libc++abi.dylib               0x000000018f3491b0 __cxa_bad_cast + 0
4   libc++abi.dylib               0x000000018f362c04 default_unexpected_handler() + 0
5   libobjc.A.dylib               0x000000018f370820 _objc_terminate() + 124
6   libc++abi.dylib               0x000000018f35f5d4 std::__terminate(void (*)()) + 16
7   libc++abi.dylib               0x000000018f35f1a8 __cxa_rethrow + 144
8   libobjc.A.dylib               0x000000018f3706f8 objc_exception_rethrow + 44
9   CoreFoundation                 0x00000001907eae00 CFRunLoopRunSpecific + 532
10  GraphicsServices               0x0000000192254074 GSEventRunModal + 100
11  UIKit                         0x0000000196aa3130 UIApplicationMain + 208
12  MobileSMS                     0x00000001000f5894 0x1000d4000 + 137364
13  libdyld.dylib                 0x000000018f7f959c start + 4

My Radar was closed as a duplicate of rdar://29251833. I've had no word from Apple on causes or workarounds.


In my case it looks like the crash was caused by me calling becomeFirstResponder on a text field in the same method where I was requesting expanded presentation mode for the extension. When I stopped calling becomeFirstResponder there, the crashes disappeared. I have no specific theory about why that should be related, so it might just be a coincidence. In my case though there's at least a clear correlation between the two, so anyone else with the same crash might give the same thing a try and see if it helps.

iMessage App crashes simulator in compact mode with soft keyboard showing up
 
 
Q