Bug 182991 - ASSERT under WebAutomationSession::setProcessPool() when running W3C test suite a second time
Summary: ASSERT under WebAutomationSession::setProcessPool() when running W3C test sui...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebDriver (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: BJ Burg
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-02-20 17:13 PST by BJ Burg
Modified: 2018-02-20 18:18 PST (History)
9 users (show)

See Also:


Attachments
Proposed Fix (3.01 KB, patch)
2018-02-20 17:20 PST, BJ Burg
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description BJ Burg 2018-02-20 17:13:24 PST
It appears that the WebProcessPool's WebAutomationSession did not get cleared properly before we set the next one. Thus, we hit this assertion:

#1	0x000000010f8cf13e in IPC::MessageReceiverMap::addMessageReceiver(IPC::StringReference, IPC::MessageReceiver&) at /Users/bburg/repos/webkit/OpenSource/Source/WebKit/Platform/IPC/MessageReceiverMap.cpp:44

    ASSERT(!m_globalMessageReceivers.contains(messageReceiverName));

Because the old session has still registered for the name "WebAutomationSession". I looked into the receiver map and saw some unrecognized pointer still registered for that name. So, my hunch is that it's an old session that wasn't cleared properly. In general, the existing pattern of relying on the destructor to run at a certain time and clean up message receivers seems bad. If the client accidentally retained the WebAutomationSession somehow, then this would behave poorly.
Comment 1 BJ Burg 2018-02-20 17:13:45 PST
<rdar://problem/37620578>
Comment 2 BJ Burg 2018-02-20 17:20:39 PST
Created attachment 334324 [details]
Proposed Fix
Comment 3 Timothy Hatcher 2018-02-20 17:23:08 PST
Comment on attachment 334324 [details]
Proposed Fix

Good call. I blame me.
Comment 4 WebKit Commit Bot 2018-02-20 18:18:02 PST
Comment on attachment 334324 [details]
Proposed Fix

Clearing flags on attachment: 334324

Committed r228854: <https://trac.webkit.org/changeset/228854>
Comment 5 WebKit Commit Bot 2018-02-20 18:18:03 PST
All reviewed patches have been landed.  Closing bug.