Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 70bf9992ad6a0ce27269c388ff2437b31acfc2b0
      
https://github.com/WebKit/WebKit/commit/70bf9992ad6a0ce27269c388ff2437b31acfc2b0
  Author: Youenn Fablet <[email protected]>
  Date:   2026-03-05 (Thu, 05 Mar 2026)

  Changed paths:
    M Source/WebCore/workers/WorkerRunLoop.cpp

  Log Message:
  -----------
  WorkerOrWorkletScriptController::loadModuleSynchronously can trigger a 
nullptr crash
rdar://171676805
https://bugs.webkit.org/show_bug.cgi?id=309182

Reviewed by Chris Dumez.

While WorkerOrWorkletScriptController::loadModuleSynchronously is executing the 
last steps, it is spinning the worker main run loop, waiting for the script to 
be retrieved.
During that time, the context might go away, meaning that 
WorkerOrWorkletGlobalScope::clearScript is called.
In this case, triggering a microtask checkpoint will trigger a nullptr crash, 
as the script is gone and there is a need to recreate the micro task queue.
To prevent this, we update WorkerMainRunLoop::runInMode to return false when 
the run loop is terminated, which happens in WorkerOrWorkletThread::stop, just 
after WorkerOrWorkletGlobalScope::clearScript call.

Canonical link: https://commits.webkit.org/308701@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to