[webkit-changes] [WebKit/WebKit] 80256b: REGRESSION(254597 at main): [ macOS wk1 Debug ] 4X im...
Chris Dumez
noreply at github.com
Fri Nov 4 09:50:42 PDT 2022
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 80256b359d2481c498bcf6d11524b0c52d9a79bf
https://github.com/WebKit/WebKit/commit/80256b359d2481c498bcf6d11524b0c52d9a79bf
Author: Chris Dumez <cdumez at apple.com>
Date: 2022-11-04 (Fri, 04 Nov 2022)
Changed paths:
M LayoutTests/platform/mac-wk1/TestExpectations
M Source/WebCore/workers/WorkerMessagingProxy.cpp
Log Message:
-----------
REGRESSION(254597 at main): [ macOS wk1 Debug ] 4X imported/w3c/web-platform-tests/upgrade-insecure-requests/gen/worker-classic.http-rp/upgrade/(Layout tests) are flakily crashing
https://bugs.webkit.org/show_bug.cgi?id=245801
rdar://100530286
Reviewed by Alex Christensen.
The tests were hitting the `m_globalScope->hasOneRef()` assertion in
WorkerOrWorkletThread::destroyWorkerGlobalScope(), indicating that something is
keeping the WorkerGlobalScope alive after its termination.
The issue was the WorkerMessagingProxy keeping the WorkerGlobalScope alive via
its m_scriptExecutionContext data member. This data member normally gets nulled
out inside WorkerMessagingProxy::workerGlobalScopeDestroyedInternal(). However,
this would only get called if we actually started a worker thread for this
Worker object. Because the first step is to actually load the script over the
network, it is possible that the Worker::terminate() gets called during script
fetching, before a worker thread has been started. In this case,
WorkerMessagingProxy::terminateWorkerGlobalScope() should clear
m_scriptExecutionContext, since nothing will clear it later on.
* LayoutTests/platform/mac-wk1/TestExpectations:
* Source/WebCore/workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::workerGlobalScopeDestroyedInternal):
Fix issue where a nested worker would fail to unregister itself as a child of
its parent worker. This was because we would null check m_workerThread, which
we had just nulled out on the previous line :/
(WebCore::WorkerMessagingProxy::terminateWorkerGlobalScope):
If there is no worker thread, clear m_scriptExecutionContext since we shouldn't
be keeping our context alive anymore and workerGlobalScopeDestroyedInternal()
won't be called to do the clearing.
Canonical link: https://commits.webkit.org/256326@main
More information about the webkit-changes
mailing list