Clicking anything in UIWebView test app in debug build hits thread assert immediately.
Created attachment 423357 [details] patch
2021-03-16 19:44:41.692075+0200 WK1VideoTest[55736:12935718] ASSERTION FAILED: !m_impl || m_impl->wasConstructedOnMainThread() == isMainThread() ASSERTION FAILED: !m_impl || m_impl->wasConstructedOnMainThread() == isMainThread() 2021-03-16 19:44:41.692233+0200 WK1VideoTest[55736:12935718] /Users/antti/Build/Debug-iphonesimulator/usr/local/include/wtf/WeakPtr.h(107) : T *WTF::WeakPtr<WebCore::Frame, WTF::EmptyCounter>::operator->() const [T = WebCore::Frame, Counter = WTF::EmptyCounter] /Users/antti/Build/Debug-iphonesimulator/usr/local/include/wtf/WeakPtr.h(107) : T *WTF::WeakPtr<WebCore::Frame, WTF::EmptyCounter>::operator->() const [T = WebCore::Frame, Counter = WTF::EmptyCounter] 2021-03-16 19:44:41.693935+0200 WK1VideoTest[55736:12935718] 1 0x123046229 WTFCrash 1 0x123046229 WTFCrash 2021-03-16 19:44:41.698947+0200 WK1VideoTest[55736:12935718] 2 0x12a93174b WTFCrashWithInfo(int, char const*, char const*, int) 2 0x12a93174b WTFCrashWithInfo(int, char const*, char const*, int) 2021-03-16 19:44:41.704032+0200 WK1VideoTest[55736:12935718] 3 0x12d40e909 WTF::WeakPtr<WebCore::Frame, WTF::EmptyCounter>::operator->() const 3 0x12d40e909 WTF::WeakPtr<WebCore::Frame, WTF::EmptyCounter>::operator->() const 2021-03-16 19:44:41.712088+0200 WK1VideoTest[55736:12935718] 4 0x12d405c30 WebCore::Document::topDocument() const 4 0x12d405c30 WebCore::Document::topDocument() const 2021-03-16 19:44:41.718365+0200 WK1VideoTest[55736:12935718] 5 0x12d691784 WebCore::Document::getTouchRects(WTF::Vector<WebCore::IntRect, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>&) 5 0x12d691784 WebCore::Document::getTouchRects(WTF::Vector<WebCore::IntRect, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>&) 2021-03-16 19:44:41.718828+0200 WK1VideoTest[55736:12935718] 6 0x10a30ecc5 -[WebView(WebPrivate) _touchEventRegions] 6 0x10a30ecc5 -[WebView(WebPrivate) _touchEventRegions] 2021-03-16 19:44:41.719259+0200 WK1VideoTest[55736:12935718] 7 0x14a11a3c2 -[UIWebBrowserView(UIWebTouchEventsGestureRecognizerDelegateImplementation) isAnyTouchOverActiveArea:] 7 0x14a11a3c2 -[UIWebBrowserView(UIWebTouchEventsGestureRecognizerDelegateImplementation) isAnyTouchOverActiveArea:] 2021-03-16 19:44:41.719700+0200 WK1VideoTest[55736:12935718] 8 0x14a15eb36 -[UIWebTouchEventsGestureRecognizer touchesBegan:withEvent:] 8 0x14a15eb36 -[UIWebTouchEventsGestureRecognizer touchesBegan:withEvent:] 2021-03-16 19:44:41.720105+0200 WK1VideoTest[55736:12935718] 9 0x14969cd2e -[UIGestureRecognizer _componentsBegan:withEvent:] 9 0x14969cd2e -[UIGestureRecognizer _componentsBegan:withEvent:] 2021-03-16 19:44:41.720513+0200 WK1VideoTest[55736:12935718] 10 0x149bff718 -[UITouchesEvent _sendEventToGestureRecognizer:] 10 0x149bff718 -[UITouchesEvent _sendEventToGestureRecognizer:] 2021-03-16 19:44:41.720874+0200 WK1VideoTest[55736:12935718] 11 0x149691647 __47-[UIGestureEnvironment _updateForEvent:window:]_block_invoke 11 0x149691647 __47-[UIGestureEnvironment _updateForEvent:window:]_block_invoke 2021-03-16 19:44:41.721222+0200 WK1VideoTest[55736:12935718] 12 0x1496912d1 -[UIGestureEnvironment _updateForEvent:window:] 12 0x1496912d1 -[UIGestureEnvironment _updateForEvent:window:] 2021-03-16 19:44:41.721579+0200 WK1VideoTest[55736:12935718] 13 0x149bb0baa -[UIWindow sendEvent:] 13 0x149bb0baa -[UIWindow sendEvent:] 2021-03-16 19:44:41.721956+0200 WK1VideoTest[55736:12935718] 14 0x149b8acbd -[UIApplication sendEvent:] 14 0x149b8acbd -[UIApplication sendEvent:] 2021-03-16 19:44:41.722315+0200 WK1VideoTest[55736:12935718] 15 0x149c1d7ee __processEventQueue 15 0x149c1d7ee __processEventQueue 2021-03-16 19:44:41.722664+0200 WK1VideoTest[55736:12935718] 16 0x149c13594 __eventFetcherSourceCallback 16 0x149c13594 __eventFetcherSourceCallback 2021-03-16 19:44:41.722840+0200 WK1VideoTest[55736:12935718] 17 0x109a34f16 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ 17 0x109a34f16 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ 2021-03-16 19:44:41.723016+0200 WK1VideoTest[55736:12935718] 18 0x109a34e0e __CFRunLoopDoSource0 18 0x109a34e0e __CFRunLoopDoSource0 2021-03-16 19:44:41.723165+0200 WK1VideoTest[55736:12935718] 19 0x109a342d6 __CFRunLoopDoSources0 19 0x109a342d6 __CFRunLoopDoSources0 2021-03-16 19:44:41.723326+0200 WK1VideoTest[55736:12935718] 20 0x109a2ea2f __CFRunLoopRun 20 0x109a2ea2f __CFRunLoopRun 2021-03-16 19:44:41.723481+0200 WK1VideoTest[55736:12935718] 21 0x109a2e1df CFRunLoopRunSpecific 21 0x109a2e1df CFRunLoopRunSpecific 2021-03-16 19:44:41.723623+0200 WK1VideoTest[55736:12935718] 22 0x10d4cfd85 GSEventRunModal 22 0x10d4cfd85 GSEventRunModal 2021-03-16 19:44:41.724003+0200 WK1VideoTest[55736:12935718] 23 0x149b6c513 -[UIApplication _run] 23 0x149b6c513 -[UIApplication _run] 2021-03-16 19:44:41.724386+0200 WK1VideoTest[55736:12935718] 24 0x149b713d0 UIApplicationMain 24 0x149b713d0 UIApplicationMain 2021-03-16 19:44:41.724518+0200 WK1VideoTest[55736:12935718] 25 0x1091466b1 main 25 0x1091466b1 main 2021-03-16 19:44:41.724641+0200 WK1VideoTest[55736:12935718] 26 0x10eec7bbd start 26 0x10eec7bbd start
Committed r274499: <https://commits.webkit.org/r274499> All reviewed patches have been landed. Closing bug and clearing flags on attachment 423357 [details].
<rdar://problem/75486328>
Re-opened since this is blocked by bug 223268
That's actually not correct, this code is actively trying to avoid taking a lock.
The assert is probably wrong here as isMainThread() returns false if the lock is not held.
The event region is protected by a separate lock though.