[Webkit-unassigned] [Bug 235224] New: [GTK][WPE][Regression] Exit cleanly if Connection to UIProcess severed

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jan 14 02:13:34 PST 2022


https://bugs.webkit.org/show_bug.cgi?id=235224

            Bug ID: 235224
           Summary: [GTK][WPE][Regression] Exit cleanly if Connection to
                    UIProcess severed
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Linux
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebKit2
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: psaavedra at igalia.com
                CC: kkinnunen at apple.com

Related-to: https://bugs.webkit.org/show_bug.cgi?id=217655#c14

I've noticed that this commit (https://bugs.webkit.org/show_bug.cgi?id=214307) have deleted some specific logic that affects to the WPE and GTK ports:


```
commit 813abc09e84c9a406836319bfa8f7fb83d378605
Author: cdumez at apple.com <cdumez at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Jul 15 18:23:22 2020 +0000

    [WK2] Make establishing a connection between the WebProcess and the Network process more robust
    https://bugs.webkit.org/show_bug.cgi?id=214307
    <rdar://problem/64592340>

    Reviewed by Alex Christensen.
```


``` diff
diff --git a/Source/WebKit/WebProcess/WebProcess.cpp b/Source/WebKit/WebProcess/WebProcess.cpp
index 6f2d8fad165f..c73c43e9857c 100644
--- a/Source/WebKit/WebProcess/WebProcess.cpp
+++ b/Source/WebKit/WebProcess/WebProcess.cpp
@@ -1100,23 +1100,28 @@ void WebProcess::setInjectedBundleParameters(const IPC::DataReference& value)
 static NetworkProcessConnectionInfo getNetworkProcessConnection(IPC::Connection& connection)
 {
     NetworkProcessConnectionInfo connectionInfo;
-    if (!connection.sendSync(Messages::WebProcessProxy::GetNetworkProcessConnection(), Messages::WebProcessProxy::GetNetworkProcessConnection::Reply(connectionInfo), 0)) {
-        // If we failed the first time, retry once. The attachment may have become invalid
-        // before it was received by the web process if the network process crashed.
-        if (!connection.sendSync(Messages::WebProcessProxy::GetNetworkProcessConnection(), Messages::WebProcessProxy::GetNetworkProcessConnection::Reply(connectionInfo), 0)) {
-#if PLATFORM(GTK) || PLATFORM(WPE)
-            // GTK+ and WPE ports don't exit on send sync message failure.
-            // In this particular case, the network process can be terminated by the UI process while the
-            // Web process is still initializing, so we always want to exit instead of crashing. This can
-            // happen when the WebView is created and then destroyed quickly.
-            // See https://bugs.webkit.org/show_bug.cgi?id=183348.
+    auto requestConnection = [&] {
+        if (!connection.isValid()) {
+            // Connection to UIProcess has been severed, exit cleanly.
             exit(0);
-#else
-            CRASH();
-#endif
...
```

The change removes the specific logic for WPE and GTK added in:

```
commit f0627f5287186ec975c3439e9bcfe119493adc95
Author: carlosgc at webkit.org <carlosgc at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu May 3 08:45:32 2018 +0000

    REGRESSION(r222772): [GTK][WPE] WebProcess from WebKitGtk+ 2.19.9x SIGSEVs in WebKit::WebProcess::ensureNetworkProcessConnection() at Source/WebKit/WebProcess/WebProcess.cpp:1127
    https://bugs.webkit.org/show_bug.cgi?id=183348
```


The comment in https://bugs.webkit.org/show_bug.cgi?id=183348#c40 offers a justification for that code.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220114/43d03a1d/attachment-0001.htm>


More information about the webkit-unassigned mailing list