Title: [275928] trunk/Source/WebKit
Revision
275928
Author
[email protected]
Date
2021-04-13 20:47:40 -0700 (Tue, 13 Apr 2021)

Log Message

Unreviewed fix after r275921 to address crashes on the iOS bots.

The crash would occur when the WebPage constructor would end up calling WebProcess::ensureGPUProcessConnection().
Since we're in the middle of constructing the page, the pageID has been added to m_pageMap but not the page yet.
ensureGPUProcessConnection() was iterating over m_pageMap and expecting pages in the map to be non-null.

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::createWebPage):
(WebKit::WebProcess::ensureGPUProcessConnection):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (275927 => 275928)


--- trunk/Source/WebKit/ChangeLog	2021-04-14 03:43:50 UTC (rev 275927)
+++ trunk/Source/WebKit/ChangeLog	2021-04-14 03:47:40 UTC (rev 275928)
@@ -1,5 +1,17 @@
 2021-04-13  Chris Dumez  <[email protected]>
 
+        Unreviewed fix after r275921 to address crashes on the iOS bots.
+
+        The crash would occur when the WebPage constructor would end up calling WebProcess::ensureGPUProcessConnection().
+        Since we're in the middle of constructing the page, the pageID has been added to m_pageMap but not the page yet.
+        ensureGPUProcessConnection() was iterating over m_pageMap and expecting pages in the map to be non-null.
+
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::createWebPage):
+        (WebKit::WebProcess::ensureGPUProcessConnection):
+
+2021-04-13  Chris Dumez  <[email protected]>
+
         RemoteRenderingBackendProxy should only relaunch the GPUProcess if it actually needs it
         https://bugs.webkit.org/show_bug.cgi?id=224516
 

Modified: trunk/Source/WebKit/WebProcess/WebProcess.cpp (275927 => 275928)


--- trunk/Source/WebKit/WebProcess/WebProcess.cpp	2021-04-14 03:43:50 UTC (rev 275927)
+++ trunk/Source/WebKit/WebProcess/WebProcess.cpp	2021-04-14 03:47:40 UTC (rev 275928)
@@ -755,11 +755,12 @@
     auto result = m_pageMap.add(pageID, nullptr);
     if (result.isNewEntry) {
         ASSERT(!result.iterator->value);
-        result.iterator->value = WebPage::create(pageID, WTFMove(parameters));
+        auto page = WebPage::create(pageID, WTFMove(parameters));
+        result.iterator->value = page.ptr();
 
 #if ENABLE(GPU_PROCESS)
         if (m_gpuProcessConnection)
-            result.iterator->value->gpuProcessConnectionDidBecomeAvailable(*m_gpuProcessConnection);
+            page->gpuProcessConnectionDidBecomeAvailable(*m_gpuProcessConnection);
 #endif
 
         // Balanced by an enableTermination in removeWebPage.
@@ -1215,8 +1216,11 @@
         m_gpuProcessConnection->setAuditToken(WTFMove(connectionInfo.auditToken));
 #endif
 
-        for (auto& page : m_pageMap.values())
-            page->gpuProcessConnectionDidBecomeAvailable(*m_gpuProcessConnection);
+        for (auto& page : m_pageMap.values()) {
+            // If page is null, then it is currently being constructed.
+            if (page)
+                page->gpuProcessConnectionDidBecomeAvailable(*m_gpuProcessConnection);
+        }
     }
     
     return *m_gpuProcessConnection;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to