Bug 239496 - [GPUProcess][Unix] RemoteRenderingBackendProxy::DidCreateWakeUpSemaphoreForDisplayListStream is never sent
Summary: [GPUProcess][Unix] RemoteRenderingBackendProxy::DidCreateWakeUpSemaphoreForDi...
Status: RESOLVED DUPLICATE of bug 239399
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Zan Dobersek
URL:
Keywords:
Depends on:
Blocks: 238593
  Show dependency treegraph
 
Reported: 2022-04-19 07:29 PDT by Zan Dobersek
Modified: 2022-04-20 12:03 PDT (History)
1 user (show)

See Also:


Attachments
The workaround (3.58 KB, patch)
2022-04-19 07:33 PDT, Zan Dobersek
no flags Details | Formatted Diff | Diff
Patch (4.30 KB, patch)
2022-04-19 08:14 PDT, Zan Dobersek
kkinnunen: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zan Dobersek 2022-04-19 07:29:45 PDT
Currently, the RemoteRenderingBackendProxy::DidCreateWakeUpSemaphoreForDisplayListStream() message is dispatched in the RemoteRenderingBackend constructor before the underlying connection is open. The connection exists, it's valid, just not open, so the message isn't sent but it's still kept in the outgoing messages queue.

There's no other message dispatched on this connection afterwards, meaning the queue doesn't get flushed. So the initial message is never sent, which then causes problems down the line in GPUProcess execution.

It's possible to rework things so that the message is sent after the connection is opened, but there's also the question of whether the Unix implementation of IPC::Connection should handle this situation somewhat better.
Comment 1 Zan Dobersek 2022-04-19 07:33:30 PDT
Created attachment 457890 [details]
The workaround
Comment 2 Zan Dobersek 2022-04-19 08:14:36 PDT
Created attachment 457892 [details]
Patch
Comment 3 Zan Dobersek 2022-04-19 08:15:44 PDT
(In reply to Zan Dobersek from comment #2)
> Created attachment 457892 [details]
> Patch

Turned it into a proper patch. It also includes the RemoteRenderingBackend::startListeningForIPC() method being folded into the constructor.
Comment 4 Kimmo Kinnunen 2022-04-20 12:03:39 PDT
Comment on attachment 457892 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=457892&action=review

> Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp:107
>      m_streamConnection->open();

This line starts invoking the virtual functions from the other thread.
The vptr of the object is set up by the constructor and is not thread-safe, so this cannot happen in the constructor.
The bug was fixed in bug 239399
Comment 5 Kimmo Kinnunen 2022-04-20 12:03:48 PDT

*** This bug has been marked as a duplicate of bug 239399 ***