WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
242142
[GPU Process] RemoteRenderingBackend must ignore resource messages once m_remoteResourceCache is cleared
https://bugs.webkit.org/show_bug.cgi?id=242142
Summary
[GPU Process] RemoteRenderingBackend must ignore resource messages once m_rem...
Said Abou-Hallawa
Reported
2022-06-29 15:24:29 PDT
RemoteRenderingBackend::stopListeningForIPC() is calling StreamServerConnection::stopReceivingMessages() after it dispatch a code block code which clear its m_remoteResourceCache. But this can allow incoming messages to be dispatched to RemoteRenderingBackend including the message RemoteRenderingBackend::ReleaseRemoteResource. If this message is received after clearing m_remoteResourceCache, GPUProcess will simulate-crash with the message "Resource is being released before being cached." To fix this, we need to call StreamServerConnection::stopReceivingMessages() before clearing the resource cache. Once this call is returned, no incoming stream connection messages can be dispatched to RemoteRenderingBackend. RemoteRenderingBackend::m_workQueue will remove RemoteRenderingBackend::m_streamConnection as its connection. And RemoteRenderingBackend::m_streamConnection will remove the RemoteRenderingBackend as its message receiver. So StreamConnectionWorkQueue::processStreams() won't process the messages of RemoteRenderingBackend::m_streamConnection. After we call StreamServerConnection::stopReceivingMessages(), we can dispatch the code block which clears m_remoteResourceCache. This code has be executed on the stream connection WorkQueue. The WorkQueue should be still running after calling StreamServerConnection::stopReceivingMessages(). It will be executed by StreamConnectionWorkQueue::processStreams() when processing m_functions. After dispatching the code block which clears m_remoteResourceCache, we need to call StreamConnectionWorkQueue::stopAndWaitForCompletion() to ensure the code block is executed and the WorkQueue has been stopped.
Attachments
Add attachment
proposed patch, testcase, etc.
Said Abou-Hallawa
Comment 1
2022-06-29 15:24:51 PDT
rdar://94143906
Said Abou-Hallawa
Comment 2
2022-06-29 15:30:44 PDT
Pull request:
https://github.com/WebKit/WebKit/pull/1919
EWS
Comment 3
2022-07-06 13:19:54 PDT
Committed
252187@main
(682daa785509): <
https://commits.webkit.org/252187@main
> Reviewed commits have been landed. Closing PR #1919 and removing active labels.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug