⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 286574 in webkit


Ignore:
Timestamp:
Dec 6, 2021, 3:37:28 PM (5 years ago)
Author:
Chris Dumez
Message:

Regression(r286505) imported/w3c/web-platform-tests/html/cross-origin-opener-policy/javascript-url.https.html is a flaky crash
https://bugs.webkit.org/show_bug.cgi?id=233874

Reviewed by Darin Adler.

r286505 fixed ProvisionalPageProxy so that ProvisionalPageProxy::m_provisionalLoadURL gets properly initialized when the
ProvisionalPageProxy gets constructed *after* the provisional load has already started (COOP proces-swap case). One side
effect of this though is that ProvisionalPageProxy::cancel() no longer returns early and will try to notify the client
that the provisional load failed, dereferencing m_mainFrame in doing so. In the event where the main frame has not yet
been created in the new provisional process, this would do a null-dereference of m_mainFrame.

To address the issue, we now early return in ProvisionalPageProxy::cancel() if m_isProcessSwappingOnNavigationResponse
is true (i.e. The ProvisionalPageProxy was created after the provisional load had started). In such situations, we
don't want to ProvisionalPageProxy to be the one notifying the client of the provisional load failure anyway. The reason
is that there is still a provisional load going on in the committed process/page.

No new tests, covered by existing test that is flakily crashing.

  • UIProcess/ProvisionalPageProxy.cpp:

(WebKit::ProvisionalPageProxy::cancel):

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r286569 r286574  
     12021-12-06  Chris Dumez  <cdumez@apple.com>
     2
     3        Regression(r286505) imported/w3c/web-platform-tests/html/cross-origin-opener-policy/javascript-url.https.html is a flaky crash
     4        https://bugs.webkit.org/show_bug.cgi?id=233874
     5
     6        Reviewed by Darin Adler.
     7
     8        r286505 fixed ProvisionalPageProxy so that ProvisionalPageProxy::m_provisionalLoadURL gets properly initialized when the
     9        ProvisionalPageProxy gets constructed *after* the provisional load has already started (COOP proces-swap case). One side
     10        effect of this though is that ProvisionalPageProxy::cancel() no longer returns early and will try to notify the client
     11        that the provisional load failed, dereferencing m_mainFrame in doing so. In the event where the main frame has not yet
     12        been created in the new provisional process, this would do a null-dereference of m_mainFrame.
     13
     14        To address the issue, we now early return in ProvisionalPageProxy::cancel() if m_isProcessSwappingOnNavigationResponse
     15        is true (i.e. The ProvisionalPageProxy was created after the provisional load had started). In such situations, we
     16        don't want to ProvisionalPageProxy to be the one notifying the client of the provisional load failure anyway. The reason
     17        is that there is still a provisional load going on in the committed process/page.
     18       
     19        No new tests, covered by existing test that is flakily crashing.
     20
     21        * UIProcess/ProvisionalPageProxy.cpp:
     22        (WebKit::ProvisionalPageProxy::cancel):
     23
    1242021-12-06  Ryan Haddad  <ryanhaddad@apple.com>
    225
  • trunk/Source/WebKit/UIProcess/ProvisionalPageProxy.cpp

    r286505 r286574  
    144144{
    145145    // If the provisional load started, then indicate that it failed due to cancellation by calling didFailProvisionalLoadForFrame().
    146     if (m_provisionalLoadURL.isEmpty())
    147         return;
    148        
     146    if (m_provisionalLoadURL.isEmpty() || m_isProcessSwappingOnNavigationResponse)
     147        return;
     148
    149149    ASSERT(m_process->state() == WebProcessProxy::State::Running);
    150150
Note: See TracChangeset for help on using the changeset viewer.