Bug 166765

Summary: ASSERTION FAILED: !m_isPointerLocked in WebKit::WebPageProxy::requestPointerLock()
Product: WebKit Reporter: Ryan Haddad <ryanhaddad>
Component: New BugsAssignee: Jeremy Jones <jeremyj-wk>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, jeremyj-wk, jonlee, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=166656
Attachments:
Description Flags
Patch
none
Patch none

Description Ryan Haddad 2017-01-06 09:02:39 PST
ASSERTION FAILED: !m_isPointerLocked
/Volumes/Data/slave/elcapitan-debug/build/Source/WebKit2/UIProcess/WebPageProxy.cpp(6763) : void WebKit::WebPageProxy::requestPointerLock()
1   0x105176e10 WTFCrash
2   0x1082a3368 WebKit::WebPageProxy::requestPointerLock()
3   0x108339a23 void IPC::callMemberFunctionImpl<WebKit::WebPageProxy, void (WebKit::WebPageProxy::*)(), std::__1::tuple<> >(WebKit::WebPageProxy*, void (WebKit::WebPageProxy::*)(), std::__1::tuple<>&&, std::__1::integer_sequence<unsigned long>)
4   0x108339998 void IPC::callMemberFunction<WebKit::WebPageProxy, void (WebKit::WebPageProxy::*)(), std::__1::tuple<>, std::__1::integer_sequence<unsigned long> >(std::__1::tuple<>&&, WebKit::WebPageProxy*, void (WebKit::WebPageProxy::*)())
5   0x108333be9 void IPC::handleMessage<Messages::WebPageProxy::RequestPointerLock, WebKit::WebPageProxy, void (WebKit::WebPageProxy::*)()>(IPC::Decoder&, WebKit::WebPageProxy*, void (WebKit::WebPageProxy::*)())
6   0x108325394 WebKit::WebPageProxy::didReceiveMessage(IPC::Connection&, IPC::Decoder&)
7   0x1083258b7 non-virtual thunk to WebKit::WebPageProxy::didReceiveMessage(IPC::Connection&, IPC::Decoder&)
8   0x107c43d14 IPC::MessageReceiverMap::dispatchMessage(IPC::Connection&, IPC::Decoder&)
9   0x107b157c7 WebKit::ChildProcessProxy::dispatchMessage(IPC::Connection&, IPC::Decoder&)
10  0x10843303a WebKit::WebProcessProxy::didReceiveMessage(IPC::Connection&, IPC::Decoder&)
11  0x108433137 non-virtual thunk to WebKit::WebProcessProxy::didReceiveMessage(IPC::Connection&, IPC::Decoder&)
12  0x107b246e3 IPC::Connection::dispatchMessage(IPC::Decoder&)
13  0x107b1b9c1 IPC::Connection::dispatchMessage(std::__1::unique_ptr<IPC::Decoder, std::__1::default_delete<IPC::Decoder> >)
14  0x107b1b4ae IPC::Connection::SyncMessageState::dispatchMessages(IPC::Connection*)
15  0x107b24009 IPC::Connection::dispatchSyncMessage(IPC::Decoder&)
16  0x107b1b982 IPC::Connection::dispatchMessage(std::__1::unique_ptr<IPC::Decoder, std::__1::default_delete<IPC::Decoder> >)
17  0x107b1b4ae IPC::Connection::SyncMessageState::dispatchMessages(IPC::Connection*)
18  0x107b2047c IPC::Connection::waitForSyncReply(unsigned long long, WTF::Seconds, WTF::OptionSet<IPC::SendSyncOption>)
19  0x107b1ebab IPC::Connection::sendSyncMessage(unsigned long long, std::__1::unique_ptr<IPC::Encoder, std::__1::default_delete<IPC::Encoder> >, WTF::Seconds, WTF::OptionSet<IPC::SendSyncOption>)
20  0x107b1e0ac IPC::Connection::sendMessage(std::__1::unique_ptr<IPC::Encoder, std::__1::default_delete<IPC::Encoder> >, WTF::OptionSet<IPC::SendOption>)
21  0x107b154c0 WebKit::ChildProcessProxy::sendMessage(std::__1::unique_ptr<IPC::Encoder, std::__1::default_delete<IPC::Encoder> >, WTF::OptionSet<IPC::SendOption>)
22  0x1082bc9c2 bool WebKit::ChildProcessProxy::send<Messages::WebPage::KeyEvent>(Messages::WebPage::KeyEvent&&, unsigned long long, WTF::OptionSet<IPC::SendOption>)
23  0x108289ce1 WebKit::WebPageProxy::handleKeyboardEvent(WebKit::NativeWebKeyboardEvent const&)
24  0x10850a909 invocation function for block in WebKit::WebViewImpl::keyDown(NSEvent*)
25  0x108507d44 WebKit::WebViewImpl::interpretKeyEvent(NSEvent*, void (signed char, WTF::Vector<WebCore::KeypressCommand, 0ul, WTF::CrashOnOverflow, 16ul> const&) block_pointer)
26  0x10850a813 WebKit::WebViewImpl::keyDown(NSEvent*)
27  0x108603346 -[WKWebView keyDown:]
28  0x103be7d97 WTR::EventSenderProxy::keyDown(OpaqueWKString const*, unsigned int, unsigned int)
29  0x103c09ac6 WTR::TestController::didReceiveKeyDownMessageFromInjectedBundle(OpaqueWKDictionary const*, bool)
30  0x103c08fa7 WTR::TestController::didReceiveSynchronousMessageFromInjectedBundle(OpaqueWKString const*, void const*)
31  0x103bffe9f WTR::TestController::didReceiveSynchronousPageMessageFromInjectedBundle(OpaqueWKPage const*, OpaqueWKString const*, void const*, void const**, void const*)
LEAK: 1 WebPage
LEAK: 1 WebFrame
LEAK: 2 XMLHttpRequest
LEAK: 70 RenderObject
LEAK: 7 Page
LEAK: 1398 WebCoreNode
LEAK: 7 Frame
LEAK: 271 CachedResource
LEAK: 23363 BidiRun

https://build.webkit.org/results/Apple%20El%20Capitan%20Debug%20WK2%20(Tests)/r210436%20(10248)/results.html
Comment 1 Ryan Haddad 2017-01-06 09:03:23 PST
Seen with these LayoutTests:

http/tests/pointer-lock/iframe-sandboxed-nested-allow-pointer-lock.html
http/tests/pointer-lock/pointerlockelement-same-origin.html
pointer-lock/lock-lost-on-alert.html
Comment 2 Ryan Haddad 2017-01-06 09:03:35 PST
<rdar://problem/29899862>
Comment 3 Ryan Haddad 2017-01-06 09:15:18 PST
Marked the affected tests as crashing on mac-wk2 debug in http://trac.webkit.org/projects/webkit/changeset/210441
Comment 4 Ryan Haddad 2017-01-19 13:37:18 PST
(In reply to comment #3)
> Marked the affected tests as crashing on mac-wk2 debug in
> http://trac.webkit.org/projects/webkit/changeset/210441

Switched the expectation to skip in https://trac.webkit.org/changeset/210937 since they show up in every run.
Comment 5 Ryan Haddad 2017-01-19 16:42:36 PST
Skipping those tests seems to have caused two more to assert:

http/tests/pointer-lock/pointerlockelement-different-origin.html
pointer-lock/lock-lost-on-esc-in-fullscreen.html

https://build.webkit.org/results/Apple%20El%20Capitan%20Debug%20WK2%20(Tests)/r210939%20(10480)/results.html
Comment 6 Ryan Haddad 2017-01-20 12:48:58 PST
After much trying, I was unable to find a single test that seemed to be causing the crashes. When I skipped all but two, the second one would frequently crash. It seems like this could be due to some state not being reset between tests.

I skipped all pointer-lock tests on mac-wk2 in https://trac.webkit.org/changeset/210975
Comment 7 Jeremy Jones 2017-01-26 11:06:09 PST
*** Bug 167445 has been marked as a duplicate of this bug. ***
Comment 8 Jeremy Jones 2017-01-26 11:07:17 PST
Created attachment 299821 [details]
Patch
Comment 9 Jon Lee 2017-01-26 11:10:49 PST
Rebase please.
Comment 10 Jeremy Jones 2017-01-26 13:23:14 PST
Created attachment 299839 [details]
Patch
Comment 11 Jeremy Jones 2017-01-26 13:23:35 PST
(In reply to comment #9)
> Rebase please.

Done.
Comment 12 Tim Horton 2017-01-26 13:54:41 PST
Comment on attachment 299839 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=299839&action=review

> Source/WebKit2/ChangeLog:9
> +        When the main frame is load is committed, pointer lock should end.
> +        This resets pointer lock state between tests and allows tests to succeed.

What about process crash?
Comment 13 Jeremy Jones 2017-01-26 15:24:09 PST
(In reply to comment #12)
> Comment on attachment 299839 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=299839&action=review
> 
> > Source/WebKit2/ChangeLog:9
> > +        When the main frame is load is committed, pointer lock should end.
> > +        This resets pointer lock state between tests and allows tests to succeed.
> 
> What about process crash?

Process crash and going into page cache are fixed here: https://bugs.webkit.org/show_bug.cgi?id=165425
Comment 14 WebKit Commit Bot 2017-01-26 15:48:25 PST
Comment on attachment 299839 [details]
Patch

Clearing flags on attachment: 299839

Committed r211234: <http://trac.webkit.org/changeset/211234>
Comment 15 WebKit Commit Bot 2017-01-26 15:48:30 PST
All reviewed patches have been landed.  Closing bug.