Created attachment 470605 [details] MXCrashDiagnostic Chrome for iOS is getting reports (through MetricKit MXCrashDiagnostic reports) of a new shutdown hang in UIAsyncTextInput-related logic, leading to watchdog kills on iOS 17.4. For context, this particular crash accounts for about 13% of all MXCrashDiagnostic reports for Chrome on iOS 17.4. The crash reasons look like: <RBSTerminateContext| domain:10 code:0x8BADF00D explanation:[app<com.google.chrome.ios((null))>:1329] failed to terminate gracefully after 5.0s\nProcessVisibility: Unknown\nProcessState: Running\nWatchdogEvent: process-exit\nWatchdogVisibility: Background\nWatchdogCPUStatistics: (\n\"Elapsed total CPU time (seconds): 4.160 (user 4.160, system 0.000), 12% CPU\",\n\"Elapsed application CPU time (seconds): 0.386, 1% CPU\"\n) reportType:CrashLog maxTerminationResistance:Interactive> I've attached a sample MXCrashDiagnostic report in case that's useful. The stack is: 0x00000001d88ee49c (libsystem_kernel.dylib + 0x0000249c) __psynch_cvwait 0x00000001ec3745bc (libsystem_pthread.dylib + 0x000015bc) _pthread_cond_wait 0x000000018f2aff14 (Foundation + 0x00086f14) -[NSCondition waitUntilDate:] 0x000000018f2afe5c (Foundation + 0x00086e5c) -[NSConditionLock lockWhenCondition:beforeDate:] 0x0000000193297474 (UIKitCore + 0x00c89474) -[UIKeyboardTaskQueue lockWhenReadyForMainThread] 0x0000000193297d20 (UIKitCore + 0x00c89d20) -[UIKeyboardTaskQueue waitUntilTaskIsFinished:] 0x000000019291bff8 (UIKitCore + 0x0030dff8) -[UIKeyboardTaskQueue performSingleTask:] 0x0000000193272384 (UIKitCore + 0x00c64384) -[UIKeyboardImpl generateAutocorrectionReplacements:] 0x00000001936da5a8 (UIKitCore + 0x010cc5a8) -[UITextReplacementGeneratorForCorrections addAutocorrectionGuessesToReplacements:] 0x00000001936daf2c (UIKitCore + 0x010ccf2c) -[UITextReplacementGeneratorForCorrections replacements] 0x00000001936e8588 (UIKitCore + 0x010da588) -[UIWKTextInteractionAssistant showReplacementsForText:withOptions:rects:] 0x00000001936e8268 (UIKitCore + 0x010da268) __68-[UIWKTextInteractionAssistant showReplacementsForText:withOptions:]_block_invoke_2 0x00000001a61e9850 (WebKit + 0x00cca850) WTF::Detail::CallableWrapper<-[WKContentView(WKInteraction) requestTextRectsForString:withCompletionHandler:]::$_105, void, WTF::Vector<WebCore::FloatRect, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc> const&>::call(WTF::Vector<WebCore::FloatRect, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc> const&) 0x00000001a5b58f24 (WebKit + 0x00639f24) WTF::Function<void (WebKit::WebAutocorrectionData)>::operator()(WebKit::WebAutocorrectionData) const 0x00000001a5b4e3c4 (WebKit + 0x0062f3c4) WTF::CompletionHandler<void (WebKit::WebAutocorrectionData)>::operator()(WebKit::WebAutocorrectionData) 0x00000001a5b5930c (WebKit + 0x0063a30c) WTF::Detail::CallableWrapper<IPC::ConnectionAsyncReplyHandler IPC::Connection::makeAsyncReplyHandler<Messages::WebPage::RequestAutocorrectionData, WTF::CompletionHandler<void (WebKit::WebAutocorrectionData)>>(WTF::CompletionHandler<void (WebKit::WebAutocorrectionData)>&&, WTF::ThreadLikeAssertion)::'lambda'(IPC::Decoder*), void, IPC::Decoder*>::call(IPC::Decoder*) 0x00000001a5b927cc (WebKit + 0x006737cc) WTF::Detail::CallableWrapper<WebKit::AuxiliaryProcessProxy::sendMessage(WTF::UniqueRef<IPC::Encoder>&&, WTF::OptionSet<IPC::SendOption>, std::__1::optional<IPC::ConnectionAsyncReplyHandler>, WebKit::AuxiliaryProcessProxy::ShouldStartProcessThrottlerActivity)::$_1, void, IPC::Decoder*>::call(IPC::Decoder*) 0x00000001a6207a5c (WebKit + 0x00ce8a5c) IPC::Connection::dispatchMessage(std::__1::unique_ptr<IPC::Decoder, std::__1::default_delete<IPC::Decoder>>) 0x00000001a6207e58 (WebKit + 0x00ce8e58) IPC::Connection::dispatchIncomingMessages() 0x00000001a6454d44 (JavaScriptCore + 0x00058d44) WTF::RunLoop::performWork() 0x00000001a6455c6c (JavaScriptCore + 0x00059c6c) WTF::RunLoop::performWork(void*) 0x00000001903c962c (CoreFoundation + 0x0003762c) __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ 0x00000001903c88a8 (CoreFoundation + 0x000368a8) __CFRunLoopDoSource0 0x00000001903c7058 (CoreFoundation + 0x00035058) __CFRunLoopDoSources0 0x00000001903c5d88 (CoreFoundation + 0x00033d88) __CFRunLoopRun 0x00000001903c5968 (CoreFoundation + 0x00033968) CFRunLoopRunSpecific 0x00000001d46bb4e0 (GraphicsServices + 0x000034e0) GSEventRunModal 0x0000000192838edc (UIKitCore + 0x0022aedc) -[UIApplication _run] 0x0000000192838518 (UIKitCore + 0x0022a518) UIApplicationMain 0x00000001002e5e10 (Chrome -chrome_exe_main.mm:102) main 0x00000001b38e6d84 (dyld + 0x00005d84) start
<rdar://problem/125435169>