Bug 218457 - REGRESSION (r269214): ASSERTION FAILED: m_state == CLOSED in WebCore::EventSource::abortConnectionAttempt
Summary: REGRESSION (r269214): ASSERTION FAILED: m_state == CLOSED in WebCore::EventSo...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
: 218461 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-11-02 13:19 PST by Ryan Haddad
Modified: 2020-11-02 19:40 PST (History)
11 users (show)

See Also:


Attachments
crash log (117.16 KB, text/plain)
2020-11-02 13:19 PST, Ryan Haddad
no flags Details
WIP Patch (1.20 KB, patch)
2020-11-02 14:40 PST, Chris Dumez
no flags Details | Formatted Diff | Diff
WIP Patch (5.77 KB, patch)
2020-11-02 14:53 PST, Chris Dumez
no flags Details | Formatted Diff | Diff
WIP Patch (788 bytes, patch)
2020-11-02 15:10 PST, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (2.84 KB, patch)
2020-11-02 16:07 PST, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryan Haddad 2020-11-02 13:19:14 PST
After the WPT re-sync in https://trac.webkit.org/changeset/269214/webkit, imported/w3c/web-platform-tests/html/dom/idlharness.worker.html has been consistently failing an assertion on iOS and macOS debug bots.

https://results.webkit.org/?suite=layout-tests&test=imported%2Fw3c%2Fweb-platform-tests%2Fhtml%2Fdom%2Fidlharness.worker.html

stderr from test:
ERROR: WebSocket network error: The operation couldn’t be completed. (kCFErrorDomainCFNetwork error 2.)
./Modules/websockets/WebSocketChannel.cpp(365) : virtual void WebCore::WebSocketChannel::didFailSocketStream(WebCore::SocketStreamHandle &, const WebCore::SocketStreamError &)
ERROR: WebSocket network error: The operation couldn’t be completed. (kCFErrorDomainCFNetwork error 2.)
./Modules/websockets/WebSocketChannel.cpp(365) : virtual void WebCore::WebSocketChannel::didFailSocketStream(WebCore::SocketStreamHandle &, const WebCore::SocketStreamError &)
CONSOLE MESSAGE: WebSocket network error: The operation couldn’t be completed. (kCFErrorDomainCFNetwork error 2.)
CONSOLE MESSAGE: WebSocket network error: The operation couldn’t be completed. (kCFErrorDomainCFNetwork error 2.)
ASSERTION FAILED: m_state == CLOSED
./page/EventSource.cpp(289) : void WebCore::EventSource::abortConnectionAttempt()
1   0x5e736df89 WTFCrash
2   0x5c65e65eb WTFCrashWithInfo(int, char const*, char const*, int)
3   0x5ca5f04da WebCore::EventSource::abortConnectionAttempt()
4   0x5ca5f02a9 WebCore::EventSource::didFail(WebCore::ResourceError const&)
5   0x5ca4701ec WebCore::ThreadableLoaderClientWrapper::didFail(WebCore::ResourceError const&)
6   0x5ca493416 WebCore::WorkerThreadableLoader::MainThreadBridge::didFail(WebCore::ResourceError const&)::$_18::operator()(WebCore::ScriptExecutionContext&)
7   0x5ca493273 WTF::Detail::CallableWrapper<WebCore::WorkerThreadableLoader::MainThreadBridge::didFail(WebCore::ResourceError const&)::$_18, void, WebCore::ScriptExecutionContext&>::call(WebCore::ScriptExecutionContext&)
8   0x5c8e9445a WTF::Function<void (WebCore::ScriptExecutionContext&)>::operator()(WebCore::ScriptExecutionContext&) const
9   0x5c8e8575d WebCore::ScriptExecutionContext::Task::performTask(WebCore::ScriptExecutionContext&)
10  0x5cb8413a0 WebCore::WorkerRunLoop::Task::performTask(WebCore::WorkerOrWorkletGlobalScope*)
11  0x5cb840897 WebCore::WorkerRunLoop::runInMode(WebCore::WorkerOrWorkletGlobalScope*, WebCore::ModePredicate const&, WebCore::WorkerRunLoop::WaitMode)
12  0x5cb83f8b8 WebCore::WorkerRunLoop::run(WebCore::WorkerOrWorkletGlobalScope*)
13  0x5cb83f858 WebCore::WorkerOrWorkletThread::runEventLoop()
14  0x5cb81a634 WebCore::DedicatedWorkerThread::runEventLoop()
15  0x5cb83fabd WebCore::WorkerOrWorkletThread::workerOrWorkletThread()
16  0x5cb87047b WebCore::WorkerThread::createThread()::$_0::operator()() const
17  0x5cb87042e WTF::Detail::CallableWrapper<WebCore::WorkerThread::createThread()::$_0, void>::call()
18  0x5e7399ca2 WTF::Function<void ()>::operator()() const
19  0x5e745c3a8 WTF::Thread::entryPoint(WTF::Thread::NewThreadContext*)
20  0x5e746a4e8 WTF::wtfThreadEntryPoint(void*)
21  0x7fff6f2a5109 _pthread_start
22  0x7fff6f2a0b8b thread_start
LEAK: 1 WebPageProxy
Comment 1 Ryan Haddad 2020-11-02 13:19:28 PST
Created attachment 412962 [details]
crash log
Comment 2 Radar WebKit Bug Importer 2020-11-02 13:19:47 PST
<rdar://problem/70963581>
Comment 3 Chris Dumez 2020-11-02 13:45:42 PST
void EventSource::abortConnectionAttempt()
{
    ASSERT(m_state == CONNECTING);
    RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(!m_isSuspendedForBackForwardCache);

    if (m_requestInFlight)
        doExplicitLoadCancellation();
    else {
        m_state = CLOSED;
        unsetPendingActivity(*this);
    }

    ASSERT(m_state == CLOSED); // Failing here.
    dispatchEvent(Event::create(eventNames().errorEvent, Event::CanBubble::No, Event::IsCancelable::No));
}
Comment 4 Chris Dumez 2020-11-02 14:40:01 PST
Created attachment 412971 [details]
WIP Patch
Comment 5 Chris Dumez 2020-11-02 14:51:40 PST
*** Bug 218461 has been marked as a duplicate of this bug. ***
Comment 6 Chris Dumez 2020-11-02 14:53:38 PST
Created attachment 412975 [details]
WIP Patch
Comment 7 Chris Dumez 2020-11-02 15:10:07 PST
Created attachment 412977 [details]
WIP Patch
Comment 8 Chris Dumez 2020-11-02 16:07:33 PST
Created attachment 412983 [details]
Patch
Comment 9 Geoffrey Garen 2020-11-02 16:29:50 PST
Comment on attachment 412983 [details]
Patch

r=me
Comment 10 EWS 2020-11-02 19:40:02 PST
Committed r269284: <https://trac.webkit.org/changeset/269284>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 412983 [details].