WebGL IPC messages are delivered out of order Sync messages are delivered before earlier async messages, if some other WebKit part waits on sync replies.
Created attachment 419430 [details] Patch
Comment on attachment 419430 [details] Patch Looks good to me. (The EWS failures are all failures to apply the patch.) Chromium had this exact bug in its IPC subsystem some time ago and I recall working on the fix. r+
I'm somewhat skeptical that this won't introduce deadlocks in more cases than you are warning about in the comment. I won't have an opportunity to think it through, so feel free to ignore my comment, but it may be good to give Chris some time to comment.
Comment on attachment 419430 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=419430&action=review > Source/WebKit/Platform/IPC/Connection.h:77 > + // Note: causes timeouts if all parties in the synchronous message chain send synchronous messages with this flag This does not look right to me. We forbid re-entrency from IPC in the WebProcess due to security bugs. Therefore, the other process must always break the deadlock by dispatching when waiting for a sync message.
(In reply to Chris Dumez from comment #4) > Comment on attachment 419430 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=419430&action=review > > > Source/WebKit/Platform/IPC/Connection.h:77 > > + // Note: causes timeouts if all parties in the synchronous message chain send synchronous messages with this flag > > This does not look right to me. We forbid re-entrency from IPC in the > WebProcess due to security bugs. Therefore, the other process must always > break the deadlock by dispatching when waiting for a sync message. This is the logic that prevents WebProcess re-entrency on IPC: // Use this flag to force synchronous messages to be treated as asynchronous messages in the WebProcess. // Otherwise, the WebProcess would process incoming synchronous IPC while waiting for a synchronous IPC // reply from the Network process, which would be unsafe. m_connection->setOnlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage(true); We are currently missing this logic on the GPUProcess connection but this is a bug that I will fix.
Created attachment 419886 [details] new approach
Committed r272680: <https://commits.webkit.org/r272680> All reviewed patches have been landed. Closing bug and clearing flags on attachment 419886 [details].
<rdar://problem/74206986>