<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>208106</bug_id>
          
          <creation_ts>2020-02-23 10:59:11 -0800</creation_ts>
          <short_desc>[GTK][WPE] Failing API tests under the Flatpak SDK environment</short_desc>
          <delta_ts>2021-09-29 06:45:24 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKitGTK</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=205658</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>208871</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Philippe Normand">pnormand</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bugs-noreply</cc>
    
    <cc>dpino</cc>
    
    <cc>mcatanzaro</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1622006</commentid>
    <comment_count>0</comment_count>
    <who name="Philippe Normand">pnormand</who>
    <bug_when>2020-02-23 10:59:11 -0800</bug_when>
    <thetext>Unexpected failures (3)
    /WebKit2Gtk/TestSSL
        /webkit/WebKitWebView/tls-errors-policy
    /WebKit2Gtk/TestUIClient
        /webkit/WebKitWebView/javascript-dialogs
    /WebKit2Gtk/TestLoaderClient
        /webkit/WebKitWebView/is-loading

Unexpected timeouts (1)
    /WebKit2Gtk/TestWebKitFaviconDatabase
        /webkit/WebKitFaviconDatabase/get-favicon

I have a proposal patch for the favicon test but the others failures are very strange. Basically, if I build WebKit with the GCC toolchain provided by the SDK, I get these failures. If I use clang, no failure.

Taking the tls-errors-policy example, the failures in the the GCC-built libs are very strange, because I can see that webkitWebViewLoadFail() is called during the load-failed signal emission, the captured stack-trace in webkitWebViewLoadFail():

    1   0x7f37a10819f0 /app/webkit/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37(+0x20f79f0) [0x7f37a10819f0]
    2   0x7f3799d80fd5 /usr/lib/x86_64-linux-gnu/libffi.so.7(+0x6fd5) [0x7f3799d80fd5]
    3   0x7f3799d803ea /usr/lib/x86_64-linux-gnu/libffi.so.7(+0x63ea) [0x7f3799d803ea]
    4   0x7f37a45902ad g_cclosure_marshal_generic
    5   0x7f37a458f7a2 g_closure_invoke
    6   0x7f37a45a3086 /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0(+0x29086) [0x7f37a45a3086]
    7   0x7f37a45ac03e g_signal_emit_valist
    8   0x7f37a45ad053 g_signal_emit
    9   0x7f37a1081f67 webkitWebViewLoadFailedWithTLSErrors(_WebKitWebView*, char const*, _GError*, GTlsCertificateFlags, _GTlsCertificate*)
    10  0x7f37a105613c NavigationClient::didFailProvisionalNavigationWithError(WebKit::WebPageProxy&amp;, WebKit::WebFrameProxy&amp;, API::Navigation*, WebCore::ResourceError const&amp;, API::Object*)
    11  0x7f37a0f97d40 WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared(WTF::Ref&lt;WebKit::WebProcessProxy, WTF::DumbPtrTraits&lt;WebKit::WebProcessProxy&gt; &gt;&amp;&amp;, WTF::ObjectIdentifier&lt;WebCore::FrameIdentifierType&gt;, WebCore::SecurityOriginData&amp;&amp;, unsigned long, WTF::String const&amp;, WebCore::ResourceError const&amp;, WebCore::WillContinueLoading, WebKit::UserData const&amp;)
    12  0x7f37a0fd3463 WebKit::WebPageProxy::didFailProvisionalLoadForFrame(WTF::ObjectIdentifier&lt;WebCore::FrameIdentifierType&gt;, WebCore::SecurityOriginData&amp;&amp;, unsigned long, WTF::String const&amp;, WebCore::ResourceError const&amp;, WebCore::WillContinueLoading, WebKit::UserData const&amp;)
    13  0x7f37a0d043ce void IPC::handleMessage&lt;Messages::WebPageProxy::DidFailProvisionalLoadForFrame, WebKit::WebPageProxy, void (WebKit::WebPageProxy::*)(WTF::ObjectIdentifier&lt;WebCore::FrameIdentifierType&gt;, WebCore::SecurityOriginData&amp;&amp;, unsigned long, WTF::String const&amp;, WebCore::ResourceError const&amp;, WebCore::WillContinueLoading, WebKit::UserData const&amp;)&gt;(IPC::Decoder&amp;, WebKit::WebPageProxy*, void (WebKit::WebPageProxy::*)(WTF::ObjectIdentifier&lt;WebCore::FrameIdentifierType&gt;, WebCore::SecurityOriginData&amp;&amp;, unsigned long, WTF::String const&amp;, WebCore::ResourceError const&amp;, WebCore::WillContinueLoading, WebKit::UserData const&amp;))
    14  0x7f37a0cdba34 WebKit::WebPageProxy::didReceiveMessage(IPC::Connection&amp;, IPC::Decoder&amp;)
    15  0x7f37a0eb72fa IPC::MessageReceiverMap::dispatchMessage(IPC::Connection&amp;, IPC::Decoder&amp;)
    16  0x7f37a0f8f09f non-virtual thunk to WebKit::WebProcessProxy::didReceiveMessage(IPC::Connection&amp;, IPC::Decoder&amp;)
    17  0x7f37a0eb0010 IPC::Connection::dispatchMessage(IPC::Decoder&amp;)
    18  0x7f37a0eb13e5 IPC::Connection::dispatchMessage(std::unique_ptr&lt;IPC::Decoder, std::default_delete&lt;IPC::Decoder&gt; &gt;)
    19  0x7f37a0eb1c7f IPC::Connection::dispatchIncomingMessages()
    20  0x7f379ea96ea9 WTF::RunLoop::performWork()
    21  0x7f379eaf8399 /app/webkit/WebKitBuild/Release/lib/libjavascriptcoregtk-4.0.so.18(+0x1442399) [0x7f379eaf8399]
    22  0x7f37a543f58e g_main_context_dispatch
    23  0x7f37a543f940 /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x53940) [0x7f37a543f940]
    24  0x7f37a543fc33 g_main_loop_run
    25  0x55fea7537ca7 /app/webkit/WebKitBuild/Release/bin/TestWebKitAPI/WebKit2Gtk/TestSSL(+0x6ca7) [0x55fea7537ca7]
    26  0x7f37a5467cae /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x7bcae) [0x7f37a5467cae]
    27  0x7f37a5467a54 /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x7ba54) [0x7f37a5467a54]
    28  0x7f37a5467a54 /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x7ba54) [0x7f37a5467a54]
    29  0x7f37a546815b g_test_run_suite
    30  0x7f37a54681b5 g_test_run
    31  0x55fea7536fea /app/webkit/WebKitBuild/Release/bin/TestWebKitAPI/WebKit2Gtk/TestSSL(+0x5fea) [0x55fea7536fea]
    32  0x7f379a24e173 __libc_start_main
    33  0x55fea753715e /app/webkit/WebKitBuild/Release/bin/TestWebKitAPI/WebKit2Gtk/TestSSL(+0x615e) [0x55fea753715e]


While it&apos;s not called in the JHBuild environment, in webkitWebViewLoadFailedWithTLSErrors() the load-failed signal is emitted but the load-failed signal class closure isn&apos;t. Is that normal?

If I upgrade my jhbuild to glib 2.62 (same version as in the SDK), I still can&apos;t reproduce the failure. This seems related to the toolchain, somehow...

The is-loading error is due to the same (mis)behavior.
The javascript-dialog failure hasn&apos;t been diagnosed yet but seems related to XvFB, if I execute the tests in my host wayland session I don&apos;t get this failure.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1628203</commentid>
    <comment_count>1</comment_count>
    <who name="Philippe Normand">pnormand</who>
    <bug_when>2020-03-10 05:58:19 -0700</bug_when>
    <thetext>Hey Michael, perhaps you&apos;d have some ideas about this issue?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1628306</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2020-03-10 10:30:49 -0700</bug_when>
    <thetext>(In reply to Philippe Normand from comment #0)
&gt; While it&apos;s not called in the JHBuild environment, in
&gt; webkitWebViewLoadFailedWithTLSErrors() the load-failed signal is emitted but
&gt; the load-failed signal class closure isn&apos;t. Is that normal?

I think I&apos;ve found the problem. loadFailedCallback in LoadTrackingTest.cpp returns void, but it needs to return a gboolean. TRUE stops other handlers (including the class closure) from being invoked, FALSE continues execution of other handlers. Because the return value is missing, the result is undefined. In the past I&apos;ve seen missing return values cause different behavior with different toolchains, so likely that&apos;s it.

Programming is hard. :(

&gt; The is-loading error is due to the same (mis)behavior.

Probably the same problem, because ViewIsLoadingTest inherits from LoadTrackingTest.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1628307</commentid>
    <comment_count>3</comment_count>
    <who name="Philippe Normand">pnormand</who>
    <bug_when>2020-03-10 10:34:32 -0700</bug_when>
    <thetext>Oh wow! Thanks Michael! I&apos;ll check this further.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1628311</commentid>
    <comment_count>4</comment_count>
    <who name="Philippe Normand">pnormand</who>
    <bug_when>2020-03-10 10:43:52 -0700</bug_when>
    <thetext>Yes indeed. Good catch. Thanks again.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1628321</commentid>
    <comment_count>5</comment_count>
    <who name="Philippe Normand">pnormand</who>
    <bug_when>2020-03-10 10:54:24 -0700</bug_when>
    <thetext>I&apos;ll try to check the WebKitWebView/javascript-dialogs failure soon.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1798302</commentid>
    <comment_count>6</comment_count>
    <who name="Philippe Normand">pnormand</who>
    <bug_when>2021-09-29 06:45:24 -0700</bug_when>
    <thetext>This was solved, I don&apos;t know when.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>