WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
321607
[Streams API] ASSERT(!resultOrException.hasException(scope)) in ReadableStreamDefaultReader::read() fires when a worker is terminated mid-read
https://bugs.webkit.org/show_bug.cgi?id=321607
Summary
[Streams API] ASSERT(!resultOrException.hasException(scope)) in ReadableStrea...
Lauro Moura
Reported
2026-08-12 10:31:31 PDT
streams/pipeTo-in-worker-terminate-crash.html This test is flaky triggering this assertion: ASSERTION FAILED: !resultOrException.hasException(scope) Source/WebCore/Modules/streams/ReadableStreamDefaultReader.cpp(124) : auto WebCore::ReadableStreamDefaultReader::read(JSDOMGlobalObject &, Ref<ReadableStreamReadRequest> &&)::(anonymous class)::operator()(auto *, bool, auto) const Crashed thread: WebCore: Worker (not main thread) #2 WTF::Detail::CallableWrapper<WebCore::ReadableStreamDefaultReader::read(...)::$_0, ...>::call(...) #4 WTF::Detail::CallableWrapper<WebCore::DOMPromise::whenPromiseIsSettled(...)::$_0, ...>::call(...) #9 JSC::runInternalMicrotask(...) #10 JSC::MicrotaskQueue::drainWithoutUseCallOnEachMicrotask(...) #11 WebCore::MicrotaskQueue::performMicrotaskCheckpoint(JSC::VM&) #12 WebCore::EventLoopTaskGroup::performMicrotaskCheckpoint(JSC::VM&) #14 WebCore::JSExecState::~JSExecState() #15 WebCore::JSExecState::profiledEvaluate(...) #16 WebCore::WorkerOrWorkletScriptController::evaluate(...) #17 WebCore::WorkerThread::evaluateScriptIfNecessary(WTF::String&) #18 WebCore::WorkerOrWorkletThread::workerOrWorkletThread() One issue identifying it was that, between hitting the assert and the actual process termination, the WebKitTestRunner instance proceeded to run other tests while generating the trace, etc. So, in some cases, other tests took the blame for the crash. For example, in the recently branched WPE 2.54 ARM job
https://build.webkit.org/#/builders/2018/builds/39
, the test `streams/readable-stream-error-messages.html` ended up being the one detected crashing. Checking ReadableStreamDefaultController.cpp, we could relax the assertion to accept this termination state. It does: EXCEPTION_ASSERT(!scope.exception() || vm.hasPendingTerminationException());
Attachments
Add attachment
proposed patch, testcase, etc.
Lauro Moura
Comment 1
2026-08-12 11:02:22 PDT
Pull request:
https://github.com/WebKit/WebKit/pull/71451
Lauro Moura
Comment 2
2026-08-12 11:13:15 PDT
***
Bug 317972
has been marked as a duplicate of this bug. ***
EWS
Comment 3
2026-08-18 12:32:56 PDT
Committed
319395@main
(868a13beabdb): <
https://commits.webkit.org/319395@main
> Reviewed commits have been landed. Closing PR #71451 and removing active labels.
Radar WebKit Bug Importer
Comment 4
2026-08-18 12:33:13 PDT
<
rdar://problem/185236661
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug