Bug 207874

Summary: TestWebKitAPI.WebKit.AllowsContentJavaScript fails on iPad simulator
Product: WebKit Reporter: Ryan Haddad <ryanhaddad>
Component: Page LoadingAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: ap, beidson, jbedard, webkit-bot-watchers-bugzilla, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Description Ryan Haddad 2020-02-17 18:12:56 PST
TestWebKitAPI.WebKit.AllowsContentJavaScript, added with https://trac.webkit.org/changeset/256715/webkit, fails when run with iPad simulator with the following output:

    TestWebKitAPI.WebKit.AllowsContentJavaScript
        LEAK: 1 WebProcessPool
        LEAK: 1 WebPageProxy
        
        File name unavailable
        Unknown C++ exception thrown in the test body.
        
Example of failure:
https://build.webkit.org/builders/Apple%20iPadOS%2013%20Simulator%20Debug%20WK2%20(Tests)/builds/1339

Result history:
https://results.webkit.org/?suite=api-tests&test=TestWebKitAPI.WebKit.AllowsContentJavaScript
Comment 1 Radar WebKit Bug Importer 2020-02-17 18:13:22 PST
<rdar://problem/59534712>
Comment 2 Alexey Proskuryakov 2020-02-18 15:56:03 PST
Similar symptom to bug 207525, but the fix should have covered iPad as well, so probably something different.
Comment 3 Wenson Hsieh 2020-02-18 16:29:48 PST
It’s definitely not the same issue as webkit.org/b/207525:

(lldb) bt
error: invalid thread
Process 45639 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
    frame #0: 0x000000010aadc982 libobjc.A.dylib`objc_exception_throw
libobjc.A.dylib`objc_exception_throw:
->  0x10aadc982 <+0>: pushq  %rbp
    0x10aadc983 <+1>: movq   %rsp, %rbp
    0x10aadc986 <+4>: pushq  %r15
    0x10aadc988 <+6>: pushq  %r14
Target 0: (TestWebKitAPI) stopped.
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
  * frame #0: 0x000000010aadc982 libobjc.A.dylib`objc_exception_throw
    frame #1: 0x000000010ad17b2c CoreFoundation`+[NSException raise:format:] + 188
    frame #2: 0x0000000111dad922 WebKit`WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction(this=0x00007fe39ad3c520, actionPolicy=WKNavigationActionPolicyAllow, policiesOrPreferences=0x00007fe3aac2a220)::$_2::operator()(WKNavigationActionPolicy, objc_object*) at NavigationState.mm:605:17
    frame #3: 0x0000000111dadeff WebKit`WTF::BlockPtr<void (WKNavigationActionPolicy, objc_object*)> WTF::BlockPtr<void (this=0x00007fe39ad3c500, ptr=0x00007fe39ad3c500, args=WKNavigationActionPolicyAllow, args=0x00007fe3aac2a220)>::fromCallable<WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction(WebKit::WebPageProxy&, WTF::Ref<API::NavigationAction, WTF::DumbPtrTraits<API::NavigationAction> >&&, WTF::Ref<WebKit::WebFramePolicyListenerProxy, WTF::DumbPtrTraits<WebKit::WebFramePolicyListenerProxy> >&&, API::Object*)::$_2>(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction(WebKit::WebPageProxy&, WTF::Ref<API::NavigationAction, WTF::DumbPtrTraits<API::NavigationAction> >&&, WTF::Ref<WebKit::WebFramePolicyListenerProxy, WTF::DumbPtrTraits<WebKit::WebFramePolicyListenerProxy> >&&, API::Object*)::$_2)::'lambda'(void*, WKNavigationActionPolicy, objc_object*)::operator()(void*, WKNavigationActionPolicy, objc_object*) const at BlockPtr.h:99:20
    frame #4: 0x0000000111dadea5 WebKit`WTF::BlockPtr<void (WKNavigationActionPolicy, objc_object*)> WTF::BlockPtr<void (ptr=0x00007fe39ad3c500, args=WKNavigationActionPolicyAllow, args=0x00007fe3aac2a220)>::fromCallable<WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction(WebKit::WebPageProxy&, WTF::Ref<API::NavigationAction, WTF::DumbPtrTraits<API::NavigationAction> >&&, WTF::Ref<WebKit::WebFramePolicyListenerProxy, WTF::DumbPtrTraits<WebKit::WebFramePolicyListenerProxy> >&&, API::Object*)::$_2>(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction(WebKit::WebPageProxy&, WTF::Ref<API::NavigationAction, WTF::DumbPtrTraits<API::NavigationAction> >&&, WTF::Ref<WebKit::WebFramePolicyListenerProxy, WTF::DumbPtrTraits<WebKit::WebFramePolicyListenerProxy> >&&, API::Object*)::$_2)::'lambda'(void*, WKNavigationActionPolicy, objc_object*)::__invoke(void*, WKNavigationActionPolicy, objc_object*) at BlockPtr.h:98:25
    frame #5: 0x0000000106dd6e05 TestWebKitAPI`__68-[TestNavigationDelegate waitForDidFinishNavigationWithPreferences:]_block_invoke(.block_descriptor=0x00007fe39d7093e0, action=0x00007fe39ad4c740, (null)=0x00007fe39ad47e90, handler=0x0000000111dade80) at TestNavigationDelegate.mm:125:9
    frame #6: 0x0000000106dd61b4 TestWebKitAPI`-[TestNavigationDelegate webView:decidePolicyForNavigationAction:preferences:decisionHandler:](self=0x00007fe39d70c160, _cmd="webView:decidePolicyForNavigationAction:preferences:decisionHandler:", webView=0x00007fe39c010400, navigationAction=0x00007fe39ad4c740, preferences=0x00007fe39ad47e90, decisionHandler=0x0000000111dade80) at TestNavigationDelegate.mm:38:9
    frame #7: 0x0000000111d9bca0 WebKit`WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction(this=0x00000001475c6040, webPageProxy=0x00007fe39c856420, navigationAction=0x00007ffee93fc8d8, listener=0x00007ffee93fc9c8, userInfo=0x0000000000000000) at NavigationState.mm:646:13
    frame #8: 0x0000000111f7d8b2 WebKit`WebKit::WebPageProxy::decidePolicyForNavigationAction(this=0x00007fe39c856420, process=0x00007ffee93fcff8, frame=0x00007fe39d70ff00, frameSecurityOrigin=0x00007ffee93fd420, navigationID=6, navigationActionData=0x00007ffee93fd450, originatingFrameInfoData=0x00007ffee93fd528, originatingPageID=Optional<WTF::ObjectIdentifier<WebKit::WebPageProxyIdentifierType> > @ 0x00007ffee93fcfe8, originalRequest=0x00007ffee93fd670, request=0x00007ffee93fd778, requestBody=0x00007ffee93fd880, redirectResponse=0x00007ffee93fd888, userData=0x00007ffee93fd980, sender=0x00007ffee93fd040) at WebPageProxy.cpp:5086:29
    frame #9: 0x0000000111f7c4b5 WebKit`WebKit::WebPageProxy::decidePolicyForNavigationActionAsyncShared(this=0x00007fe39c856420, process=0x00007ffee93fd1f0, webPageID=(m_identifier = 7), frameID=(m_identifier = 20), frameSecurityOrigin=0x00007ffee93fd420, identifier=PolicyCheckIdentifier @ 0x00007ffee93fd0c0, navigationID=0, navigationActionData=0x00007ffee93fd450, frameInfoData=0x00007ffee93fd528, originatingPageID=Optional<WTF::ObjectIdentifier<WebKit::WebPageProxyIdentifierType> > @ 0x00007ffee93fd1c0, originalRequest=0x00007ffee93fd670, request=0x00007ffee93fd778, requestBody=0x00007ffee93fd880, redirectResponse=0x00007ffee93fd888, userData=0x00007ffee93fd980, listenerID=6) at WebPageProxy.cpp:4926:5
    frame #10: 0x0000000111f7c166 WebKit`WebKit::WebPageProxy::decidePolicyForNavigationActionAsync(this=0x00007fe39c856420, frameID=(m_identifier = 20), frameSecurityOrigin=0x00007ffee93fd420, identifier=PolicyCheckIdentifier @ 0x00007ffee93fd210, navigationID=0, navigationActionData=0x00007ffee93fd450, frameInfoData=0x00007ffee93fd528, originatingPageID=Optional<WTF::ObjectIdentifier<WebKit::WebPageProxyIdentifierType> > @ 0x00007ffee93fd310, originalRequest=0x00007ffee93fd670, request=0x00007ffee93fd778, requestBody=0x00007ffee93fd880, redirectResponse=0x00007ffee93fd888, userData=0x00007ffee93fd980, listenerID=6) at WebPageProxy.cpp:4910:5
    frame #11: 0x0000000112a637ce WebKit`void IPC::callMemberFunctionImpl<WebKit::WebPageProxy, void (WebKit::WebPageProxy::*)(WTF::ObjectIdentifier<WebCore::FrameIdentifierType>, WebCore::SecurityOriginData&&, WebCore::PolicyCheckIdentifier, unsigned long long, WebKit::NavigationActionData&&, WebKit::FrameInfoData&&, WTF::Optional<WTF::ObjectIdentifier<WebKit::WebPageProxyIdentifierType> >, WebCore::ResourceRequest const&, WebCore::ResourceRequest&&, IPC::FormDataReference&&, WebCore::ResourceResponse&&, WebKit::UserData const&, unsigned long long), std::__1::tuple<WTF::ObjectIdentifier<WebCore::FrameIdentifierType>, WebCore::SecurityOriginData, WebCore::PolicyCheckIdentifier, unsigned long long, WebKit::NavigationActionData, WebKit::FrameInfoData, WTF::Optional<WTF::ObjectIdentifier<WebKit::WebPageProxyIdentifierType> >, WebCore::ResourceRequest, WebCore::ResourceRequest, IPC::FormDataReference, WebCore::ResourceResponse, WebKit::UserData, unsigned long long>, 0ul, 1ul, 2ul, 3ul, 4ul, 5ul, 6ul, 7ul, 8ul, 9ul, 10ul, 11ul, 12ul>(object=0x00007fe39c856420, function=30 bf f7 11 01 00 00 00 00 00 00 00 00 00 00 00, args=size=13, (null)=std::__1::index_sequence<0UL, 1UL, 2UL, 3UL, 4UL, 5UL, 6UL, 7UL, 8UL, 9UL, 10UL, 11UL, 12UL> @ 0x00007ffee93fd358)(WTF::ObjectIdentifier<WebCore::FrameIdentifierType>, WebCore::SecurityOriginData&&, WebCore::PolicyCheckIdentifier, unsigned long long, WebKit::NavigationActionData&&, WebKit::FrameInfoData&&, WTF::Optional<WTF::ObjectIdentifier<WebKit::WebPageProxyIdentifierType> >, WebCore::ResourceRequest const&, WebCore::ResourceRequest&&, IPC::FormDataReference&&, WebCore::ResourceResponse&&, WebKit::UserData const&, unsigned long long), std::__1::tuple<WTF::ObjectIdentifier<WebCore::FrameIdentifierType>, WebCore::SecurityOriginData, WebCore::PolicyCheckIdentifier, unsigned long long, WebKit::NavigationActionData, WebKit::FrameInfoData, WTF::Optional<WTF::ObjectIdentifier<WebKit::WebPageProxyIdentifierType> >, WebCore::ResourceRequest, WebCore::ResourceRequest, IPC::FormDataReference, WebCore::ResourceResponse, WebKit::UserData, unsigned long long>&&, std::__1::integer_sequence<unsigned long, 0ul, 1ul, 2ul, 3ul, 4ul, 5ul, 6ul, 7ul, 8ul, 9ul, 10ul, 11ul, 12ul>) at HandleMessage.h:41:5
    frame #12: 0x0000000112a63570 WebKit`void IPC::callMemberFunction<WebKit::WebPageProxy, void (WebKit::WebPageProxy::*)(WTF::ObjectIdentifier<WebCore::FrameIdentifierType>, WebCore::SecurityOriginData&&, WebCore::PolicyCheckIdentifier, unsigned long long, WebKit::NavigationActionData&&, WebKit::FrameInfoData&&, WTF::Optional<WTF::ObjectIdentifier<WebKit::WebPageProxyIdentifierType> >, WebCore::ResourceRequest const&, WebCore::ResourceRequest&&, IPC::FormDataReference&&, WebCore::ResourceResponse&&, WebKit::UserData const&, unsigned long long), std::__1::tuple<WTF::ObjectIdentifier<WebCore::FrameIdentifierType>, WebCore::SecurityOriginData, WebCore::PolicyCheckIdentifier, unsigned long long, WebKit::NavigationActionData, WebKit::FrameInfoData, WTF::Optional<WTF::ObjectIdentifier<WebKit::WebPageProxyIdentifierType> >, WebCore::ResourceRequest, WebCore::ResourceRequest, IPC::FormDataReference, WebCore::ResourceResponse, WebKit::UserData, unsigned long long>, std::__1::integer_sequence<unsigned long, 0ul, 1ul, 2ul, 3ul, 4ul, 5ul, 6ul, 7ul, 8ul, 9ul, 10ul, 11ul, 12ul> >(args=size=13, object=0x00007fe39c856420, function=30 bf f7 11 01 00 00 00 00 00 00 00 00 00 00 00)(WTF::ObjectIdentifier<WebCore::FrameIdentifierType>, WebCore::SecurityOriginData&&, WebCore::PolicyCheckIdentifier, unsigned long long, WebKit::NavigationActionData&&, WebKit::FrameInfoData&&, WTF::Optional<WTF::ObjectIdentifier<WebKit::WebPageProxyIdentifierType> >, WebCore::ResourceRequest const&, WebCore::ResourceRequest&&, IPC::FormDataReference&&, WebCore::ResourceResponse&&, WebKit::UserData const&, unsigned long long)) at HandleMessage.h:47:5
    frame #13: 0x0000000112a3ff1b WebKit`void IPC::handleMessage<Messages::WebPageProxy::DecidePolicyForNavigationActionAsync, WebKit::WebPageProxy, void (WebKit::WebPageProxy::*)(WTF::ObjectIdentifier<WebCore::FrameIdentifierType>, WebCore::SecurityOriginData&&, WebCore::PolicyCheckIdentifier, unsigned long long, WebKit::NavigationActionData&&, WebKit::FrameInfoData&&, WTF::Optional<WTF::ObjectIdentifier<WebKit::WebPageProxyIdentifierType> >, WebCore::ResourceRequest const&, WebCore::ResourceRequest&&, IPC::FormDataReference&&, WebCore::ResourceResponse&&, WebKit::UserData const&, unsigned long long)>(decoder=0x0000000147559d00, object=0x00007fe39c856420, function=30 bf f7 11 01 00 00 00 00 00 00 00 00 00 00 00)(WTF::ObjectIdentifier<WebCore::FrameIdentifierType>, WebCore::SecurityOriginData&&, WebCore::PolicyCheckIdentifier, unsigned long long, WebKit::NavigationActionData&&, WebKit::FrameInfoData&&, WTF::Optional<WTF::ObjectIdentifier<WebKit::WebPageProxyIdentifierType> >, WebCore::ResourceRequest const&, WebCore::ResourceRequest&&, IPC::FormDataReference&&, WebCore::ResourceResponse&&, WebKit::UserData const&, unsigned long long)) at HandleMessage.h:120:5
(lldb) po $arg1
WKWebpagePreferences._customUserAgent must be nil for subframe navigations.
Comment 4 Alexey Proskuryakov 2020-02-18 16:35:00 PST
> WKWebpagePreferences._customUserAgent must be nil for subframe navigations.

That... Sounds like a big deal?
Comment 5 Ryan Haddad 2020-03-11 17:16:45 PDT
This continues to fail on the iPad simulator bots.
Comment 6 Ryan Haddad 2020-05-08 14:42:10 PDT
Disabled the test for iOS with r261418