Changeset 276712 in webkit
- Timestamp:
- Apr 28, 2021, 8:20:48 AM (5 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
UIProcess/WebProcessPool.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r276706 r276712 1 2021-04-28 Chris Dumez <cdumez@apple.com> 2 3 Crash under GPUProcessProxy::getGPUProcessConnection() 4 https://bugs.webkit.org/show_bug.cgi?id=224017 5 <rdar://75146104> 6 7 Reviewed by Darin Adler. 8 9 The crash would happen when replyToPendingMessages() get called in the AuxiliaryProcessProxy 10 destructor and there would be a pending getGPUProcessConnection() IPC. The lambda in 11 WebProcessPool::getGPUProcessConnection() would check if a WeakPtr to the WebProcessPool is 12 valid before calling `ensureGPUProcess().getGPUProcessConnection()`. However, at this point, 13 the WebProcessPool destructor is still running so the WeakPtr is still valid but 14 `ensureGPUProcess().getGPUProcessConnection()` will crash because the GPUProcessProxy 15 destructor has already run. 16 17 * UIProcess/WebProcessPool.cpp: 18 (WebKit::WebProcessPool::~WebProcessPool): 19 Drop code that was causing the GPUProcessProxy to reply to all its pending IPC messages whenenever 20 a WebProcessPool gets destroyed. This is incorrect since a GPUProcessProxy may be shared by several 21 WebProcessPool objects. Note that the AuxiliaryProcessProxy destructor already takes care of 22 calling replyToPendingMessages(). 23 24 (WebKit::WebProcessPool::getGPUProcessConnection): 25 Protect the WebProcessPool is the lambda to prevent the case where this lambda gets called and the 26 WebProcessPool & GPUProcessProxy are in the middle of destruction. 27 1 28 2021-04-28 Kimmo Kinnunen <kkinnunen@apple.com> 2 29 -
trunk/Source/WebKit/UIProcess/WebProcessPool.cpp
r276148 r276712 361 361 #endif 362 362 363 #if ENABLE(GPU_PROCESS)364 if (m_gpuProcess)365 m_gpuProcess->replyToPendingMessages();366 #endif367 368 363 // Only remaining processes should be pre-warmed ones as other keep the process pool alive. 369 364 while (!m_processes.isEmpty()) { … … 530 525 void WebProcessPool::getGPUProcessConnection(WebProcessProxy& webProcessProxy, GPUProcessConnectionParameters&& parameters, Messages::WebProcessProxy::GetGPUProcessConnection::DelayedReply&& reply) 531 526 { 532 ensureGPUProcess().getGPUProcessConnection(webProcessProxy, parameters, [this, weakThis = makeWeakPtr(*this), parameters, webProcessProxy = makeWeakPtr(webProcessProxy), reply = WTFMove(reply)] (auto& connectionInfo) mutable {533 if (UNLIKELY(!IPC::Connection::identifierIsValid(connectionInfo.identifier()) && webProcessProxy && weakThis)) {527 ensureGPUProcess().getGPUProcessConnection(webProcessProxy, parameters, [this, protectedThis = makeRef(*this), parameters, webProcessProxy = makeWeakPtr(webProcessProxy), reply = WTFMove(reply)] (auto& connectionInfo) mutable { 528 if (UNLIKELY(!IPC::Connection::identifierIsValid(connectionInfo.identifier()) && webProcessProxy)) { 534 529 WEBPROCESSPOOL_RELEASE_LOG_ERROR(Process, "getGPUProcessConnection: Failed first attempt, retrying"); 535 530 ensureGPUProcess().getGPUProcessConnection(*webProcessProxy, parameters, WTFMove(reply));
Note:
See TracChangeset
for help on using the changeset viewer.