Bug 183644

Summary: MessagePort should remove its listeners when being closed
Product: WebKit Reporter: youenn fablet <youennf>
Component: Service WorkersAssignee: youenn fablet <youennf>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, commit-queue, dbates, esprehn+autocc, ews-watchlist, kangil.han, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch for landing none

Description youenn fablet 2018-03-14 14:10:58 PDT
Otherwise we end up with something like:
1   0x628c6e97d WTFCrash
2   0x6199a5ca1 WebCore::JSVMClientData::~JSVMClientData()
3   0x6199a5eb5 WebCore::JSVMClientData::~JSVMClientData()
4   0x6199a5ed9 WebCore::JSVMClientData::~JSVMClientData()
5   0x6289e13ca JSC::VM::~VM()
6   0x6289e4065 JSC::VM::~VM()
7   0x627717e77 WTF::ThreadSafeRefCounted<JSC::VM>::deref() const
8   0x628458cc1 void WTF::derefIfNotNull<JSC::VM>(JSC::VM*)
9   0x6284499e7 WTF::RefPtr<JSC::VM, WTF::DumbPtrTraits<JSC::VM> >::operator=(std::nullptr_t)
10  0x628867dfa JSC::JSLockHolder::~JSLockHolder()
11  0x628867e75 JSC::JSLockHolder::~JSLockHolder()
12  0x6199a739a WebCore::WorkerScriptController::~WorkerScriptController()
13  0x6199a75a5 WebCore::WorkerScriptController::~WorkerScriptController()
14  0x61b3889f2 WebCore::WorkerGlobalScope::clearScript()
15  0x61b388936 WebCore::WorkerThread::stop(WTF::Function<void ()>&&)::$_16::operator()(WebCore::ScriptExecutionContext&) const::'lambda'(WebCore::ScriptExecutionContext&)::operator()(WebCore::ScriptExecutionContext&) const
16  0x61b3888e4 WTF::Function<void (WebCore::ScriptExecutionContext&)>::CallableWrapper<WebCore::WorkerThread::stop(WTF::Function<void ()>&&)::$_16::operator()(WebCore::ScriptExecutionContext&) const::'lambda'(WebCore::ScriptExecutionContext&)>::call(WebCore::ScriptExecutionContext&)
17  0x6197e062e WTF::Function<void (WebCore::ScriptExecutionContext&)>::operator()(WebCore::ScriptExecutionContext&) const
18  0x6197cdead WebCore::ScriptExecutionContext::Task::performTask(WebCore::ScriptExecutionContext&)
19  0x61b3777a0 WebCore::WorkerRunLoop::Task::performTask(WebCore::WorkerGlobalScope*)
20  0x61b376b4e WebCore::WorkerRunLoop::runCleanupTasks(WebCore::WorkerGlobalScope*)
21  0x61b3761e0 WebCore::WorkerRunLoop::run(WebCore::WorkerGlobalScope*)
22  0x61b37ad23 WebCore::WorkerThread::runEventLoop()
23  0x61b35e948 WebCore::DedicatedWorkerThread::runEventLoop()
24  0x61b37a870 WebCore::WorkerThread::workerThread()
25  0x61b386778 WebCore::WorkerThread::start(WTF::Function<void (WTF::String const&)>&&)::$_12::operator()() const
26  0x61b386739 WTF::Function<void ()>::CallableWrapper<WebCore::WorkerThread::start(WTF::Function<void (WTF::String const&)>&&)::$_12>::call()
27  0x628c8a87b WTF::Function<void ()>::operator()() const
28  0x628cfab9f WTF::Thread::entryPoint(WTF::Thread::NewThreadContext*)
29  0x628d002f5 WTF::wtfThreadEntryPoint(void*)
30  0x7fff7fabe6c1 _pthread_body
31  0x7fff7fabe56d _pthread_body
Comment 1 youenn fablet 2018-03-14 14:12:44 PDT
Created attachment 335797 [details]
Patch
Comment 2 Chris Dumez 2018-03-14 14:24:22 PDT
Comment on attachment 335797 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=335797&action=review

r=me if the bots are happy.

> LayoutTests/http/tests/workers/worker-messageport.html:1
> +<body>

Missing <html> since you have a </html>

> LayoutTests/http/tests/workers/worker-messageport.html:14
> +        // do GC in worker

This comment seems weird.
Comment 3 youenn fablet 2018-03-14 14:28:38 PDT
Created attachment 335802 [details]
Patch for landing
Comment 4 WebKit Commit Bot 2018-03-14 15:20:39 PDT
Comment on attachment 335802 [details]
Patch for landing

Clearing flags on attachment: 335802

Committed r229614: <https://trac.webkit.org/changeset/229614>
Comment 5 WebKit Commit Bot 2018-03-14 15:20:40 PDT
All reviewed patches have been landed.  Closing bug.
Comment 6 Radar WebKit Bug Importer 2018-03-14 15:21:48 PDT
<rdar://problem/38476200>