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

Changeset 286609 in webkit


Ignore:
Timestamp:
Dec 7, 2021, 12:42:25 PM (5 years ago)
Author:
Chris Dumez
Message:

ASSERTION FAILED: m_messagesBeingDispatched.isEmpty() on http/tests/resourceLoadStatistics/website-data-removal-for-site-with-user-interaction.html
https://bugs.webkit.org/show_bug.cgi?id=228164
<rdar://problem/80914914>

Reviewed by Darin Adler.

Source/WebKit:

dispatchMessagesAndResetDidScheduleDispatchMessagesForConnection() has an assertion to make sure that m_messagesBeingDispatched
was empty when getting called. However, in the case where there is a nested run loop, the call to
m_messagesBeingDispatched.takeFirst().dispatch() at the end of the function may cause the function to re-enter. When entering,
m_messagesBeingDispatched may not be empty so the assertion is wrong. Looking at the code, I think dropping the assertion is the
right thing to do as the implementation seems to be doing something sane upon re-entering. It will just append new messages to
m_messagesBeingDispatched and then try and dispatch them. Based on how it is implemented, message ordering would be preserved.

No new tests, unskipped existing test.

  • Platform/IPC/Connection.cpp:

(IPC::Connection::SyncMessageState::dispatchMessagesAndResetDidScheduleDispatchMessagesForConnection):

LayoutTests:

Unskip test that should no longer be crashing.

  • platform/ios-wk2/TestExpectations:
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r286603 r286609  
     12021-12-07  Chris Dumez  <cdumez@apple.com>
     2
     3        ASSERTION FAILED: m_messagesBeingDispatched.isEmpty() on http/tests/resourceLoadStatistics/website-data-removal-for-site-with-user-interaction.html
     4        https://bugs.webkit.org/show_bug.cgi?id=228164
     5        <rdar://problem/80914914>
     6
     7        Reviewed by Darin Adler.
     8
     9        Unskip test that should no longer be crashing.
     10
     11        * platform/ios-wk2/TestExpectations:
     12
    1132021-12-07  Kyle Piddington  <kpiddington@apple.com>
    214
  • trunk/LayoutTests/platform/ios-wk2/TestExpectations

    r286577 r286609  
    20232023http/tests/resourceLoadStatistics/exemptDomains/ [ Pass ]
    20242024
    2025 webkit.org/b/228164 [ Debug ] http/tests/resourceLoadStatistics/website-data-removal-for-site-with-user-interaction.html [ Pass Crash ]
    2026 
    20272025webkit.org/b/216492 [ Debug ] imported/w3c/web-platform-tests/selection/extend-20.html [ Slow ]
    20282026
  • trunk/Source/WebKit/ChangeLog

    r286604 r286609  
     12021-12-07  Chris Dumez  <cdumez@apple.com>
     2
     3        ASSERTION FAILED: m_messagesBeingDispatched.isEmpty() on http/tests/resourceLoadStatistics/website-data-removal-for-site-with-user-interaction.html
     4        https://bugs.webkit.org/show_bug.cgi?id=228164
     5        <rdar://problem/80914914>
     6
     7        Reviewed by Darin Adler.
     8
     9        dispatchMessagesAndResetDidScheduleDispatchMessagesForConnection() has an assertion to make sure that m_messagesBeingDispatched
     10        was empty when getting called. However, in the case where there is a nested run loop, the call to
     11        `m_messagesBeingDispatched.takeFirst().dispatch()` at the end of the function may cause the function to re-enter. When entering,
     12        m_messagesBeingDispatched may not be empty so the assertion is wrong. Looking at the code, I think dropping the assertion is the
     13        right thing to do as the implementation seems to be doing something sane upon re-entering. It will just append new messages to
     14        m_messagesBeingDispatched and then try and dispatch them. Based on how it is implemented, message ordering would be preserved.
     15
     16        No new tests, unskipped existing test.
     17
     18        * Platform/IPC/Connection.cpp:
     19        (IPC::Connection::SyncMessageState::dispatchMessagesAndResetDidScheduleDispatchMessagesForConnection):
     20
    1212021-12-07  Chris Dumez  <cdumez@apple.com>
    222
  • trunk/Source/WebKit/Platform/IPC/Connection.cpp

    r285177 r286609  
    227227        ASSERT(m_didScheduleDispatchMessagesWorkSet.contains(&connection));
    228228        m_didScheduleDispatchMessagesWorkSet.remove(&connection);
    229         ASSERT(m_messagesBeingDispatched.isEmpty());
    230229        Deque<ConnectionAndIncomingMessage> messagesToPutBack;
    231230        for (auto& connectionAndIncomingMessage : m_messagesToDispatchWhileWaitingForSyncReply) {
     
    239238
    240239    while (!m_messagesBeingDispatched.isEmpty())
    241         m_messagesBeingDispatched.takeFirst().dispatch();
     240        m_messagesBeingDispatched.takeFirst().dispatch(); // This may cause the function to re-enter when there is a nested run loop.
    242241}
    243242
Note: See TracChangeset for help on using the changeset viewer.