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.
<rdar://problem/37620578>
Created attachment 334324 [details] Proposed Fix
Comment on attachment 334324 [details] Proposed Fix Good call. I blame me.
Comment on attachment 334324 [details] Proposed Fix Clearing flags on attachment: 334324 Committed r228854: <https://trac.webkit.org/changeset/228854>
All reviewed patches have been landed. Closing bug.