<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [GTK] ASSERTION FAILED: !m_mainFrame-&gt;coreFrame()-&gt;loader().frameHasLoaded() || !m_pendingNavigationID when reloading page while a page is loading"
   href="https://bugs.webkit.org/show_bug.cgi?id=153210">153210</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[GTK] ASSERTION FAILED: !m_mainFrame-&gt;coreFrame()-&gt;loader().frameHasLoaded() || !m_pendingNavigationID when reloading page while a page is loading
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>Minor
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>WebKit Gtk
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned&#64;lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>mcatanzaro&#64;igalia.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>bugs-noreply&#64;webkitgtk.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The little test program pasted below, which calls webkit_web_view_load_uri() twice in a row and webkit_web_view_reload() on LOAD_FINISHED, triggers the following assert:

ASSERTION FAILED: !m_mainFrame-&gt;coreFrame()-&gt;loader().frameHasLoaded() || !m_pendingNavigationID
../../Source/WebKit2/WebProcess/WebPage/WebPage.cpp(1171) : void WebKit::WebPage::reload(uint64_t, bool, bool, const SandboxExtension::Handle &amp;)

We should handle this gracefully. If this is really a programmer error (and while the test program is nonsensical, I do not believe this should be an error) then we should emit a critical warning rather than assert.


/* gcc test.c `pkg-config --cflags --libs webkit2gtk-4.0` */

#include &lt;gtk/gtk.h&gt;
#include &lt;stdio.h&gt;
#include &lt;webkit2/webkit2.h&gt;

void
load_changed_cb (WebKitWebView   *web_view,
                 WebKitLoadEvent  load_event,
                 gpointer         user_data)
{

  if (load_event == WEBKIT_LOAD_FINISHED)
    {
      webkit_web_view_reload (web_view);
      return;
    }
}

int
main (void)
{
  GtkWidget *web_view;
  GtkWidget *window;

  gtk_init (NULL, NULL);

  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);

  web_view = webkit_web_view_new ();
  g_signal_connect (web_view, &quot;load-changed&quot;, G_CALLBACK (load_changed_cb), NULL);
  webkit_web_view_load_uri (WEBKIT_WEB_VIEW (web_view), &quot;<a href="https://www.gnome.org">https://www.gnome.org</a>&quot;);
  webkit_web_view_load_uri (WEBKIT_WEB_VIEW (web_view), &quot;<a href="https://www.webkit.org">https://www.webkit.org</a>&quot;);
  gtk_container_add (GTK_CONTAINER (window), web_view);

  gtk_widget_set_size_request (web_view, 600, 500);
  gtk_widget_show_all (window);

  gtk_main ();

  return 0;
}

ASSERTION FAILED: !m_mainFrame-&gt;coreFrame()-&gt;loader().frameHasLoaded() || !m_pendingNavigationID
../../Source/WebKit2/WebProcess/WebPage/WebPage.cpp(1171) : void WebKit::WebPage::reload(uint64_t, bool, bool, const SandboxExtension::Handle &amp;)
1   0x7f2c14c552dd /home/mcatanzaro/src/jhbuild/install/lib/libjavascriptcoregtk-4.0.so.18(WTFCrash+0x1d) [0x7f2c14c552dd]
2   0x7f2c195f7dd3 /home/mcatanzaro/src/jhbuild/install/lib/libwebkit2gtk-4.0.so.37(_ZN6WebKit7WebPage6reloadEmbbRKNS_16SandboxExtension6HandleE+0xd3) [0x7f2c195f7dd3]
3   0x7f2c198849ca /home/mcatanzaro/src/jhbuild/install/lib/libwebkit2gtk-4.0.so.37(_ZN3IPC22callMemberFunctionImplIN6WebKit7WebPageEMS2_FvmbbRKNS1_16SandboxExtension6HandleEESt5tupleIJmbbS4_EEJLm0ELm1ELm2ELm3EEEEvPT_T0_OT1_St14index_sequenceIJXspT2_EEE+0xfa) [0x7f2c198849ca]
4   0x7f2c198842ec /home/mcatanzaro/src/jhbuild/install/lib/libwebkit2gtk-4.0.so.37(_ZN3IPC18callMemberFunctionIN6WebKit7WebPageEMS2_FvmbbRKNS1_16SandboxExtension6HandleEESt5tupleIJmbbS4_EESt19make_index_sequenceILm4EEEEvOT1_PT_T0_+0x6c) [0x7f2c198842ec]
5   0x7f2c1987946a /home/mcatanzaro/src/jhbuild/install/lib/libwebkit2gtk-4.0.so.37(_ZN3IPC13handleMessageIN8Messages7WebPage6ReloadEN6WebKit7WebPageEMS5_FvmbbRKNS4_16SandboxExtension6HandleEEEEvRNS_14MessageDecoderEPT0_T1_+0x10a) [0x7f2c1987946a]
6   0x7f2c19874302 /home/mcatanzaro/src/jhbuild/install/lib/libwebkit2gtk-4.0.so.37(_ZN6WebKit7WebPage24didReceiveWebPageMessageERN3IPC10ConnectionERNS1_14MessageDecoderE+0xf92) [0x7f2c19874302]
7   0x7f2c195ff8da /home/mcatanzaro/src/jhbuild/install/lib/libwebkit2gtk-4.0.so.37(_ZN6WebKit7WebPage17didReceiveMessageERN3IPC10ConnectionERNS1_14MessageDecoderE+0x17a) [0x7f2c195ff8da]
8   0x7f2c195ff924 /home/mcatanzaro/src/jhbuild/install/lib/libwebkit2gtk-4.0.so.37(_ZThn16_N6WebKit7WebPage17didReceiveMessageERN3IPC10ConnectionERNS1_14MessageDecoderE+0x34) [0x7f2c195ff924]
9   0x7f2c191cff68 /home/mcatanzaro/src/jhbuild/install/lib/libwebkit2gtk-4.0.so.37(_ZN3IPC18MessageReceiverMap15dispatchMessageERNS_10ConnectionERNS_14MessageDecoderE+0x118) [0x7f2c191cff68]
10  0x7f2c194541fd /home/mcatanzaro/src/jhbuild/install/lib/libwebkit2gtk-4.0.so.37(_ZN6WebKit10WebProcess17didReceiveMessageERN3IPC10ConnectionERNS1_14MessageDecoderE+0x3d) [0x7f2c194541fd]
11  0x7f2c191ba8c3 /home/mcatanzaro/src/jhbuild/install/lib/libwebkit2gtk-4.0.so.37(_ZN3IPC10Connection15dispatchMessageERNS_14MessageDecoderE+0x33) [0x7f2c191ba8c3]
12  0x7f2c191b5376 /home/mcatanzaro/src/jhbuild/install/lib/libwebkit2gtk-4.0.so.37(_ZN3IPC10Connection15dispatchMessageESt10unique_ptrINS_14MessageDecoderESt14default_deleteIS2_EE+0x166) [0x7f2c191b5376]
13  0x7f2c191ba9eb /home/mcatanzaro/src/jhbuild/install/lib/libwebkit2gtk-4.0.so.37(_ZN3IPC10Connection18dispatchOneMessageEv+0x11b) [0x7f2c191ba9eb]
14  0x7f2c191bd4ad /home/mcatanzaro/src/jhbuild/install/lib/libwebkit2gtk-4.0.so.37(+0x3b014ad) [0x7f2c191bd4ad]
15  0x7f2c191bd2cd /home/mcatanzaro/src/jhbuild/install/lib/libwebkit2gtk-4.0.so.37(+0x3b012cd) [0x7f2c191bd2cd]
16  0x7f2c1910a28e /home/mcatanzaro/src/jhbuild/install/lib/libwebkit2gtk-4.0.so.37(_ZNKSt8functionIFvvEEclEv+0x3e) [0x7f2c1910a28e]
17  0x7f2c14c72ada /home/mcatanzaro/src/jhbuild/install/lib/libjavascriptcoregtk-4.0.so.18(_ZN3WTF7RunLoop11performWorkEv+0x13a) [0x7f2c14c72ada]
18  0x7f2c14cb5fac /home/mcatanzaro/src/jhbuild/install/lib/libjavascriptcoregtk-4.0.so.18(+0x1999fac) [0x7f2c14cb5fac]
19  0x7f2c14cb5f88 /home/mcatanzaro/src/jhbuild/install/lib/libjavascriptcoregtk-4.0.so.18(+0x1999f88) [0x7f2c14cb5f88]
20  0x7f2c14cb5f61 /home/mcatanzaro/src/jhbuild/install/lib/libjavascriptcoregtk-4.0.so.18(+0x1999f61) [0x7f2c14cb5f61]
21  0x7f2c14cb5f08 /home/mcatanzaro/src/jhbuild/install/lib/libjavascriptcoregtk-4.0.so.18(+0x1999f08) [0x7f2c14cb5f08]
22  0x7f2c10b6e632 /home/mcatanzaro/src/jhbuild/install/lib/libglib-2.0.so.0(+0x47632) [0x7f2c10b6e632]
23  0x7f2c10b70ded /home/mcatanzaro/src/jhbuild/install/lib/libglib-2.0.so.0(g_main_context_dispatch+0x23) [0x7f2c10b70ded]
24  0x7f2c10b70f36 /home/mcatanzaro/src/jhbuild/install/lib/libglib-2.0.so.0(+0x49f36) [0x7f2c10b70f36]
25  0x7f2c10b712ff /home/mcatanzaro/src/jhbuild/install/lib/libglib-2.0.so.0(g_main_loop_run+0x18a) [0x7f2c10b712ff]
26  0x7f2c14cb589f /home/mcatanzaro/src/jhbuild/install/lib/libjavascriptcoregtk-4.0.so.18(_ZN3WTF7RunLoop3runEv+0xaf) [0x7f2c14cb589f]
27  0x7f2c197bcf1d /home/mcatanzaro/src/jhbuild/install/lib/libwebkit2gtk-4.0.so.37(_ZN6WebKit16ChildProcessMainINS_10WebProcessENS_14WebProcessMainEEEiiPPc+0xfd) [0x7f2c197bcf1d]
28  0x7f2c197bce0b /home/mcatanzaro/src/jhbuild/install/lib/libwebkit2gtk-4.0.so.37(WebProcessMainUnix+0x1b) [0x7f2c197bce0b]
29  0x400c26 /home/mcatanzaro/src/jhbuild/install/libexec/webkit2gtk-4.0/WebKitWebProcess(main+0x46) [0x400c26]
30  0x7f2c0a623580 /lib64/libc.so.6(__libc_start_main+0xf0) [0x7f2c0a623580]
31  0x400b09 /home/mcatanzaro/src/jhbuild/install/libexec/webkit2gtk-4.0/WebKitWebProcess(_start+0x29) [0x400b09]</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>