Changeset 228854 in webkit


Ignore:
Timestamp:
Feb 20, 2018 6:17:57 PM (6 years ago)
Author:
BJ Burg
Message:

ASSERT under WebAutomationSession::setProcessPool() when running W3C test suite a second time
https://bugs.webkit.org/show_bug.cgi?id=182991
<rdar://problem/37620578>

Reviewed by Timothy Hatcher.

Sometimes when running more than one session end-to-end with the same browser instance,
UIProcess would crash under addMessageReceiver because another WebAutomationSession was still
registered. This is hard to reproduce, but upon code inspection, the receiver management code
is somewhat problematic because it only runs when the WebAutomationSession destructor runs.
In some cases the client could retain two sessions and cause the first one to never remove itself
as the message receiver.

Instead of unregistering the session as a message receiver underneath the session's destructor,
do this whenever a new session supplants an old session since there is only one active session at a time.

  • UIProcess/Automation/WebAutomationSession.cpp:

(WebKit::WebAutomationSession::~WebAutomationSession):

  • UIProcess/WebProcessPool.cpp:

(WebKit::WebProcessPool::setAutomationSession):

Location:
trunk/Source/WebKit
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r228853 r228854  
     12018-02-20  Brian Burg  <bburg@apple.com>
     2
     3        ASSERT under WebAutomationSession::setProcessPool() when running W3C test suite a second time
     4        https://bugs.webkit.org/show_bug.cgi?id=182991
     5        <rdar://problem/37620578>
     6
     7        Reviewed by Timothy Hatcher.
     8
     9        Sometimes when running more than one session end-to-end with the same browser instance,
     10        UIProcess would crash under addMessageReceiver because another WebAutomationSession was still
     11        registered. This is hard to reproduce, but upon code inspection, the receiver management code
     12        is somewhat problematic because it only runs when the WebAutomationSession destructor runs.
     13        In some cases the client could retain two sessions and cause the first one to never remove itself
     14        as the message receiver.
     15
     16        Instead of unregistering the session as a message receiver underneath the session's destructor,
     17        do this whenever a new session supplants an old session since there is only one active session at a time.
     18
     19        * UIProcess/Automation/WebAutomationSession.cpp:
     20        (WebKit::WebAutomationSession::~WebAutomationSession):
     21        * UIProcess/WebProcessPool.cpp:
     22        (WebKit::WebProcessPool::setAutomationSession):
     23
    1242018-02-20  Tim Horton  <timothy_horton@apple.com>
    225
  • trunk/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp

    r228434 r228854  
    7272{
    7373    ASSERT(!m_client);
    74 
    75     if (m_processPool)
    76         m_processPool->removeMessageReceiver(Messages::WebAutomationSession::messageReceiverName());
     74    ASSERT(!m_processPool);
    7775}
    7876
  • trunk/Source/WebKit/UIProcess/WebProcessPool.cpp

    r228587 r228854  
    15031503void WebProcessPool::setAutomationSession(RefPtr<WebAutomationSession>&& automationSession)
    15041504{
     1505    if (m_automationSession)
     1506        m_automationSession->setProcessPool(nullptr);
     1507   
    15051508    m_automationSession = WTFMove(automationSession);
    15061509
Note: See TracChangeset for help on using the changeset viewer.