<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [GTK] WebProcess should run cleanup on quit to release resources"
   href="https://bugs.webkit.org/show_bug.cgi?id=168126#c1">Comment # 1</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [GTK] WebProcess should run cleanup on quit to release resources"
   href="https://bugs.webkit.org/show_bug.cgi?id=168126">bug 168126</a>
              from <span class="vcard"><a class="email" href="mailto:olivier.blin&#64;softathome.com" title="Olivier Blin &lt;olivier.blin&#64;softathome.com&gt;"> <span class="fn">Olivier Blin</span></a>
</span></b>
        <pre>We could catch SIGINT in the WebProcess, as discussed on IRC with Zan and Konstantin a few months ago, but there is no ideal method to call to run the WebProcess exit.

If we add a SIGINT handler and do nothing more, the IPC connection close will eventually be detected.
But in release mode, WebProcess::didClose() does not run the WebPage cleanup.

After enabling the code that runs WebPage::close() in WebProcess::didClose(), the WebProcess will exit even earlier because of extra IPC failure checks:

#0  __GI_exit (status=0) at exit.c:104
#1  0x00007f914bceda79 in IPC::Connection::sendSyncMessage(unsigned long, std::unique_ptr&lt;IPC::Encoder, std::default_delete&lt;IPC::Encoder&gt; &gt;, WTF::Seconds, WTF::OptionSet&lt;IPC::SendSyncOption&gt;) () from libwebkit2gtk-4.0.so.37
#2  0x00007f914bdf35fb in bool IPC::Connection::sendSync&lt;Messages::WebProcessProxy::ShouldTerminate&gt;(Messages::WebProcessProxy::ShouldTerminate&amp;&amp;, Messages::WebProcessProxy::ShouldTerminate::Reply&amp;&amp;, unsigned long, WTF::Seconds, WTF::OptionSet&lt;IPC::SendSyncOption&gt;) () from libwebkit2gtk-4.0.so.37
#3  0x00007f914bdedec8 in WebKit::WebProcess::shouldTerminate() () from libwebkit2gtk-4.0.so.37
#4  0x00007f914bcfc4e3 in WebKit::ChildProcess::enableTermination() () from libwebkit2gtk-4.0.so.37
#5  0x00007f914be76da0 in WebKit::WebPage::close() () from libwebkit2gtk-4.0.so.37
#6  0x00007f914bdee178 in WebKit::WebProcess::didClose(IPC::Connection&amp;) () from libwebkit2gtk-4.0.so.37

And if we call WebProcess::singleton().parentProcessConnection()-&gt;setShouldExitOnSyncMessageSendFailure(false) in the SIGINT handler, this leads to different crashes later on.</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>