Title: [252809] trunk/Source/WebKit
Revision
252809
Author
[email protected]
Date
2019-11-22 15:14:13 -0800 (Fri, 22 Nov 2019)

Log Message

Null check callback in NetworkConnectionToWebProcess::didDeliverMessagePortMessages
https://bugs.webkit.org/show_bug.cgi?id=204460
<rdar://problem/57348618>

Reviewed by Chris Dumez.

When the network process crashes during a message port connection establishment,
a web process may have an identifier that becomes stale.  In this case, we should not crash again.
No test because this only happens during a rare race condition after a network process crash, but the radar shows records of this happening.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::didDeliverMessagePortMessages):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (252808 => 252809)


--- trunk/Source/WebKit/ChangeLog	2019-11-22 23:10:51 UTC (rev 252808)
+++ trunk/Source/WebKit/ChangeLog	2019-11-22 23:14:13 UTC (rev 252809)
@@ -1,3 +1,18 @@
+2019-11-22  Alex Christensen  <[email protected]>
+
+        Null check callback in NetworkConnectionToWebProcess::didDeliverMessagePortMessages
+        https://bugs.webkit.org/show_bug.cgi?id=204460
+        <rdar://problem/57348618>
+
+        Reviewed by Chris Dumez.
+
+        When the network process crashes during a message port connection establishment,
+        a web process may have an identifier that becomes stale.  In this case, we should not crash again.
+        No test because this only happens during a rare race condition after a network process crash, but the radar shows records of this happening.
+
+        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
+        (WebKit::NetworkConnectionToWebProcess::didDeliverMessagePortMessages):
+
 2019-11-22  Sihui Liu  <[email protected]>
 
         Cross-thread version StorageQuotaManager

Modified: trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp (252808 => 252809)


--- trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp	2019-11-22 23:10:51 UTC (rev 252808)
+++ trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp	2019-11-22 23:14:13 UTC (rev 252809)
@@ -994,9 +994,9 @@
 
 void NetworkConnectionToWebProcess::didDeliverMessagePortMessages(uint64_t messageBatchIdentifier)
 {
-    auto callback = m_messageBatchDeliveryCompletionHandlers.take(messageBatchIdentifier);
-    ASSERT(callback);
-    callback();
+    // Null check only necessary for rare condition where network process crashes during message port connection establishment.
+    if (auto callback = m_messageBatchDeliveryCompletionHandlers.take(messageBatchIdentifier))
+        callback();
 }
 
 void NetworkConnectionToWebProcess::postMessageToRemote(MessageWithMessagePorts&& message, const MessagePortIdentifier& port)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to