Title: [293035] trunk/Source/WebKit
Revision
293035
Author
[email protected]
Date
2022-04-19 13:33:05 -0700 (Tue, 19 Apr 2022)

Log Message

ASSERTION FAILED: !m_isInitializingSendSource crashes on the bots
https://bugs.webkit.org/show_bug.cgi?id=239399

Patch by Kimmo Kinnunen <[email protected]> on 2022-04-19
Reviewed by Chris Dumez.

Avoid sending messages to IPC::Connection before the connection is open.
There's multiple logic problems as well as a race to toggle m_isInitializingSendSource.

Commit "RemoteRenderingBackend should have dedicated IPC::Connection for out-of-stream messages"
would make RRBProxy in WP create the "server" IPC::Connection and send that to RRB in GPUP.
This would cause RRB in GPUP to ASSERT(... || !m_isInitializingSendSource) fail in
the IPC work queue.

For "client" connection, IPC::Connection::open() will run in the calling queue, toggling
m_isInitializingSendSource = true. The m_isInitializingSendSource = false will be toggled
in the message send queue by the send source initialization callback.

If the caller has already enqueued messages before calling open(), the callbacks the
sendMessage() or open() schedules might run the functions which do not expect to be dispatched unless
m_isInitializingSendSource == false.

This commit just fixes the send vs open order, but does not fix the underlying problems.
They are tracked in bug 239494, which should also add tests for the case.

* GPUProcess/graphics/RemoteRenderingBackend.cpp:
(WebKit::RemoteRenderingBackend::RemoteRenderingBackend):
(WebKit::RemoteRenderingBackend::startListeningForIPC):
* Platform/IPC/cocoa/ConnectionCocoa.mm:
(IPC::Connection::sendOutgoingMessage):
Expand one ASSERT(!a && !b) to individual assertions in order to catch the exact problem easier.

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (293034 => 293035)


--- trunk/Source/WebKit/ChangeLog	2022-04-19 20:31:44 UTC (rev 293034)
+++ trunk/Source/WebKit/ChangeLog	2022-04-19 20:33:05 UTC (rev 293035)
@@ -1,3 +1,36 @@
+2022-04-19  Kimmo Kinnunen  <[email protected]>
+
+        ASSERTION FAILED: !m_isInitializingSendSource crashes on the bots
+        https://bugs.webkit.org/show_bug.cgi?id=239399
+
+        Reviewed by Chris Dumez.
+
+        Avoid sending messages to IPC::Connection before the connection is open.
+        There's multiple logic problems as well as a race to toggle m_isInitializingSendSource.
+
+        Commit "RemoteRenderingBackend should have dedicated IPC::Connection for out-of-stream messages"
+        would make RRBProxy in WP create the "server" IPC::Connection and send that to RRB in GPUP.
+        This would cause RRB in GPUP to ASSERT(... || !m_isInitializingSendSource) fail in
+        the IPC work queue.
+
+        For "client" connection, IPC::Connection::open() will run in the calling queue, toggling
+        m_isInitializingSendSource = true. The m_isInitializingSendSource = false will be toggled
+        in the message send queue by the send source initialization callback.
+
+        If the caller has already enqueued messages before calling open(), the callbacks the
+        sendMessage() or open() schedules might run the functions which do not expect to be dispatched unless
+        m_isInitializingSendSource == false.
+
+        This commit just fixes the send vs open order, but does not fix the underlying problems.
+        They are tracked in bug 239494, which should also add tests for the case.
+
+        * GPUProcess/graphics/RemoteRenderingBackend.cpp:
+        (WebKit::RemoteRenderingBackend::RemoteRenderingBackend):
+        (WebKit::RemoteRenderingBackend::startListeningForIPC):
+        * Platform/IPC/cocoa/ConnectionCocoa.mm:
+        (IPC::Connection::sendOutgoingMessage):
+        Expand one ASSERT(!a && !b) to individual assertions in order to catch the exact problem easier.
+
 2022-04-19  Ada Chan  <[email protected]>
 
         [WebXR] Update Device::initializeTrackingAndRendering() to take in more parameters regarding the session setup

Modified: trunk/Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp (293034 => 293035)


--- trunk/Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp	2022-04-19 20:31:44 UTC (rev 293034)
+++ trunk/Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp	2022-04-19 20:33:05 UTC (rev 293035)
@@ -99,7 +99,6 @@
 #endif
 {
     ASSERT(RunLoop::isMain());
-    send(Messages::RemoteRenderingBackendProxy::DidCreateWakeUpSemaphoreForDisplayListStream(m_workQueue->wakeUpSemaphore()), m_renderingBackendIdentifier);
 }
 
 RemoteRenderingBackend::~RemoteRenderingBackend() = default;
@@ -112,6 +111,7 @@
     }
     m_streamConnection->startReceivingMessages(*this, Messages::RemoteRenderingBackend::messageReceiverName(), m_renderingBackendIdentifier.toUInt64());
     m_streamConnection->open();
+    send(Messages::RemoteRenderingBackendProxy::DidCreateWakeUpSemaphoreForDisplayListStream(m_workQueue->wakeUpSemaphore()), m_renderingBackendIdentifier);
 }
 
 void RemoteRenderingBackend::stopListeningForIPC()

Modified: trunk/Source/WebKit/Platform/IPC/cocoa/ConnectionCocoa.mm (293034 => 293035)


--- trunk/Source/WebKit/Platform/IPC/cocoa/ConnectionCocoa.mm	2022-04-19 20:31:44 UTC (rev 293034)
+++ trunk/Source/WebKit/Platform/IPC/cocoa/ConnectionCocoa.mm	2022-04-19 20:33:05 UTC (rev 293035)
@@ -286,7 +286,8 @@
 
 bool Connection::sendOutgoingMessage(UniqueRef<Encoder>&& encoder)
 {
-    ASSERT(!m_pendingOutgoingMachMessage && !m_isInitializingSendSource);
+    ASSERT(!m_pendingOutgoingMachMessage);
+    ASSERT(!m_isInitializingSendSource);
 
     auto attachments = encoder->releaseAttachments();
     
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to