Bug 206427

Summary: [iOS] ASSERTION FAILED: ASSERT_NOT_REACHED() in selectionChangedWithTouch(WKContentView*, WebCore::IntPoint const&, unsigned int, unsigned int, WebKit::CallbackBase::Error)
Product: WebKit Reporter: Daniel Bates <dbates>
Component: WebKit Misc.Assignee: Daniel Bates <dbates>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Local Build   
Hardware: iPhone / iPad   
OS: iOS 13   
Attachments:
Description Flags
Patch none

Description Daniel Bates 2020-01-17 10:28:57 PST
While trying to drag selected text in a text field on iOS the web process crashed then I hit the assertion ASSERT_NOT_REACHED in selectionChangedWithTouch():

[[
#2  0x00000001093e8b74 in selectionChangedWithTouch(WKContentView*, WebCore::IntPoint const&, unsigned int, unsigned int, WebKit::CallbackBase::Error) at /Volumes/.../Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:3855
#3  0x00000001093e8ac0 in -[WKContentView(WKInteraction) changeSelectionWithTouchAt:withSelectionTouch:baseIsStart:withFlags:]::$_12::operator()(WebCore::IntPoint const&, unsigned int, unsigned int, WebKit::CallbackBase::Error) const at /Volumes/.../Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:3885
#4  0x00000001093e8a0c in WTF::Detail::CallableWrapper<-[WKContentView(WKInteraction) changeSelectionWithTouchAt:withSelectionTouch:baseIsStart:withFlags:]::$_12, void, WebCore::IntPoint const&, unsigned int, unsigned int, WebKit::CallbackBase::Error>::call(WebCore::IntPoint const&, unsigned int, unsigned int, WebKit::CallbackBase::Error) at /Volumes/.../Source/WTF/wtf/Function.h:52
#5  0x000000010881a688 in WTF::Function<void (WebCore::IntPoint const&, unsigned int, unsigned int, WebKit::CallbackBase::Error)>::operator()(WebCore::IntPoint const&, unsigned int, unsigned int, WebKit::CallbackBase::Error) const at /Volumes/.../Source/WTF/wtf/Function.h:84
#6  0x000000010883c0f4 in WebKit::GenericCallback<WebCore::IntPoint const&, unsigned int, unsigned int>::invalidate(WebKit::CallbackBase::Error) at /Volumes/.../Source/WebKit/UIProcess/GenericCallback.h:125
#7  0x00000001085a7380 in void WebKit::invalidateCallbackMap<WTF::RefPtr<WebKit::CallbackBase, WTF::DumbPtrTraits<WebKit::CallbackBase> > >(WTF::HashMap<unsigned long long, WTF::RefPtr<WebKit::CallbackBase, WTF::DumbPtrTraits<WebKit::CallbackBase> >, WTF::IntHash<unsigned long long>, WTF::HashTraits<unsigned long long>, WTF::HashTraits<WTF::RefPtr<WebKit::CallbackBase, WTF::DumbPtrTraits<WebKit::CallbackBase> > > >&, WebKit::CallbackBase::Error) at /Volumes/.../Source/WebKit/UIProcess/GenericCallback.h:167
#8  0x000000010859bec4 in WebKit::CallbackMap::invalidate(WebKit::CallbackBase::Error) at /Volumes/.../Source/WebKit/UIProcess/GenericCallback.h:214
#9  0x00000001085cf43c in WebKit::WebPageProxy::resetState(WebKit::WebPageProxy::ResetStateReason) at /Volumes/.../Source/WebKit/UIProcess/WebPageProxy.cpp:7387
#10 0x00000001085fb6f8 in WebKit::WebPageProxy::resetStateAfterProcessExited(WebKit::ProcessTerminationReason) at /Volumes/.../Source/WebKit/UIProcess/WebPageProxy.cpp:7451
#11 0x00000001085de1d4 in WebKit::WebPageProxy::processDidTerminate(WebKit::ProcessTerminationReason) at /Volumes/.../Source/WebKit/UIProcess/WebPageProxy.cpp:7160
#12 0x00000001086fed50 in WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch() at /Volumes/.../Source/WebKit/UIProcess/WebProcessProxy.cpp:794
#13 0x00000001086fe970 in WebKit::WebProcessProxy::didClose(IPC::Connection&) at /Volumes/.../Source/WebKit/UIProcess/WebProcessProxy.cpp:751
#14 0x0000000107a40e94 in IPC::Connection::connectionDidClose()::$_6::operator()() at /Volumes/.../Source/WebKit/Platform/IPC/Connection.cpp:873
#15 0x0000000107a40d70 in WTF::Detail::CallableWrapper<IPC::Connection::connectionDidClose()::$_6, void>::call() at /Volumes/.../Source/WTF/wtf/Function.h:52
#16 0x0000000101336778 in WTF::Function<void ()>::operator()() const at /Volumes/.../Source/WTF/wtf/Function.h:84
#17 0x000000010139c5bc in WTF::RunLoop::performWork() at /Volumes/.../Source/WTF/wtf/RunLoop.cpp:107
#18 0x000000010139d0bc in WTF::RunLoop::performWork(void*) at /Volumes/.../Source/WTF/wtf/cf/RunLoopCF.cpp:38
]]
Comment 1 Daniel Bates 2020-01-17 10:29:38 PST
(lldb) p error
(WebKit::CallbackBase::Error) $0 = ProcessExited
Comment 2 Daniel Bates 2020-01-17 10:32:42 PST
The assertion looks invalid. We are being called back to tell us that the process exited.
Comment 3 Daniel Bates 2020-01-17 10:52:58 PST
Created attachment 388060 [details]
Patch
Comment 4 Daniel Bates 2020-01-17 13:59:43 PST
Thanks for the review!
Comment 5 Daniel Bates 2020-01-17 15:35:49 PST
Comment on attachment 388060 [details]
Patch

Clearing flags on attachment: 388060

Committed r254769: <https://trac.webkit.org/changeset/254769>
Comment 6 Daniel Bates 2020-01-17 15:35:50 PST
All reviewed patches have been landed.  Closing bug.
Comment 7 Radar WebKit Bug Importer 2020-01-17 15:36:15 PST
<rdar://problem/58698357>