Title: [187124] trunk/Source/WebKit2
Revision
187124
Author
[email protected]
Date
2015-07-21 14:39:58 -0700 (Tue, 21 Jul 2015)

Log Message

ASSERT(m_suspendMessageCount >= 0) fails in ProcessThrottler::didCancelProcessSuspension()
when WebContent process crashes; Network process may never voluntarily suspend
https://bugs.webkit.org/show_bug.cgi?id=147122
<rdar://problem/21906759>

Reviewed by Chris Dumez.

Fixes an issue where the network process may never voluntarily release its process assertion.

Currently the network process always sends both a ProcessReadyToSuspend and CancelPrepareToSuspend
message in response to receiving a PrepareToSuspend message and CancelPrepareToSuspend message,
respectively. The process throttler expects to receive either a ProcessReadyToSuspend message
or a CancelPrepareToSuspend message (and not both) in response to sending the message sequence
PrepareToSuspend, CancelPrepareToSuspend. When a process throttler receives both messages in
response to this sequence then its internal message count becomes imbalanced and it will
never release the process assertion it manages. One user interaction that can cause such an
imbalance, in the process throttler held by NetworkProcessProxy, is switching tabs.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::cancelPrepareToSuspend): Do not send message NetworkProcessProxy::DidCancelProcessSuspension.
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::didCancelProcessSuspension): Deleted.
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in: Remove message NetworkProcessProxy::DidCancelProcessSuspension.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (187123 => 187124)


--- trunk/Source/WebKit2/ChangeLog	2015-07-21 21:23:26 UTC (rev 187123)
+++ trunk/Source/WebKit2/ChangeLog	2015-07-21 21:39:58 UTC (rev 187124)
@@ -1,3 +1,30 @@
+2015-07-21  Daniel Bates  <[email protected]>
+
+        ASSERT(m_suspendMessageCount >= 0) fails in ProcessThrottler::didCancelProcessSuspension()
+        when WebContent process crashes; Network process may never voluntarily suspend
+        https://bugs.webkit.org/show_bug.cgi?id=147122
+        <rdar://problem/21906759>
+
+        Reviewed by Chris Dumez.
+
+        Fixes an issue where the network process may never voluntarily release its process assertion.
+
+        Currently the network process always sends both a ProcessReadyToSuspend and CancelPrepareToSuspend
+        message in response to receiving a PrepareToSuspend message and CancelPrepareToSuspend message,
+        respectively. The process throttler expects to receive either a ProcessReadyToSuspend message
+        or a CancelPrepareToSuspend message (and not both) in response to sending the message sequence
+        PrepareToSuspend, CancelPrepareToSuspend. When a process throttler receives both messages in
+        response to this sequence then its internal message count becomes imbalanced and it will
+        never release the process assertion it manages. One user interaction that can cause such an
+        imbalance, in the process throttler held by NetworkProcessProxy, is switching tabs.
+
+        * NetworkProcess/NetworkProcess.cpp:
+        (WebKit::NetworkProcess::cancelPrepareToSuspend): Do not send message NetworkProcessProxy::DidCancelProcessSuspension. 
+        * UIProcess/Network/NetworkProcessProxy.cpp:
+        (WebKit::NetworkProcessProxy::didCancelProcessSuspension): Deleted.
+        * UIProcess/Network/NetworkProcessProxy.h:
+        * UIProcess/Network/NetworkProcessProxy.messages.in: Remove message NetworkProcessProxy::DidCancelProcessSuspension.
+
 2015-07-21  Matthew Daiter  <[email protected]>
 
         Make sure to invalidate requests for user media after webpage reset

Modified: trunk/Source/WebKit2/NetworkProcess/NetworkProcess.cpp (187123 => 187124)


--- trunk/Source/WebKit2/NetworkProcess/NetworkProcess.cpp	2015-07-21 21:23:26 UTC (rev 187123)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkProcess.cpp	2015-07-21 21:39:58 UTC (rev 187124)
@@ -521,7 +521,10 @@
 
 void NetworkProcess::cancelPrepareToSuspend()
 {
-    parentProcessConnection()->send(Messages::NetworkProcessProxy::DidCancelProcessSuspension(), 0);
+    // Although it is tempting to send a NetworkProcessProxy::DidCancelProcessSuspension message from here
+    // we do not because prepareToSuspend() already replied with a NetworkProcessProxy::ProcessReadyToSuspend
+    // message. And NetworkProcessProxy expects to receive either a NetworkProcessProxy::ProcessReadyToSuspend-
+    // or NetworkProcessProxy::DidCancelProcessSuspension- message, but not both.
 }
 
 void NetworkProcess::processDidResume()

Modified: trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.cpp (187123 => 187124)


--- trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.cpp	2015-07-21 21:23:26 UTC (rev 187123)
+++ trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.cpp	2015-07-21 21:39:58 UTC (rev 187124)
@@ -351,11 +351,6 @@
         send(Messages::NetworkProcess::CancelPrepareToSuspend(), 0);
 }
 
-void NetworkProcessProxy::didCancelProcessSuspension()
-{
-    m_throttler.didCancelProcessSuspension();
-}
-
 void NetworkProcessProxy::sendProcessDidResume()
 {
     if (canSendMessage())

Modified: trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.h (187123 => 187124)


--- trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.h	2015-07-21 21:23:26 UTC (rev 187123)
+++ trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.h	2015-07-21 21:39:58 UTC (rev 187124)
@@ -69,7 +69,6 @@
     void setProcessSuppressionEnabled(bool);
 #endif
 
-    void didCancelProcessSuspension();
     void processReadyToSuspend();
 
     void setIsHoldingLockedFiles(bool);

Modified: trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.messages.in (187123 => 187124)


--- trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.messages.in	2015-07-21 21:23:26 UTC (rev 187123)
+++ trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.messages.in	2015-07-21 21:39:58 UTC (rev 187124)
@@ -32,7 +32,6 @@
     DidDeleteWebsiteDataForOrigins(uint64_t callbackID)
 
     ProcessReadyToSuspend()
-    DidCancelProcessSuspension()
     SetIsHoldingLockedFiles(bool isHoldingLockedFiles)
 
     # Diagnostic messages logging
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to