<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>265263</bug_id>
          
          <creation_ts>2023-11-22 12:23:50 -0800</creation_ts>
          <short_desc>Enable dedicated workers in shared workers</short_desc>
          <delta_ts>2026-05-03 22:51:02 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebCore Misc.</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar, WPTImpact</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ahmad Saleem">ahmad.saleem792</reporter>
          <assigned_to name="Anne van Kesteren">annevk</assigned_to>
          <cc>annevk</cc>
    
    <cc>cdumez</cc>
    
    <cc>fujii</cc>
    
    <cc>mike</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>youennf</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1994436</commentid>
    <comment_count>0</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-11-22 12:23:50 -0800</bug_when>
    <thetext>Hi Team,

While looking into Workers.idl file in WebKit, I noticed that it is not exposed to &apos;SharedWorker&apos; as per Web standard.

Web-Spec: https://html.spec.whatwg.org/multipage/workers.html#dedicated-workers-and-the-worker-interface

WebKit Source: https://searchfox.org/wubkat/rev/225be872c8ca8c801d73c28d87205f6bef773846/Source/WebCore/workers/Worker.idl#29

It might be leading to following WPT test failure (didn&apos;t test or confirmed).

WPT Test Case: https://wpt.fyi/results/workers/semantics/interface-objects/003.any.sharedworker.html?label=master&amp;label=experimental&amp;aligned=&amp;q=safari%3Afail

Or if it is not progressing above, it might be failing few others.

I just wanted to raise so we can fix it.

Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1994440</commentid>
    <comment_count>1</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-11-22 12:43:33 -0800</bug_when>
    <thetext>It progresses following:

http://wpt.live/workers/semantics/interface-objects/003.any.sharedworker.html

http://wpt.live/workers/semantics/multiple-workers/exposure.any.sharedworker.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1994753</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2023-11-25 13:37:08 -0800</bug_when>
    <thetext>Does it work when exposed? We do support nested workers, but I&apos;m not sure if it automatically means that workers inside shared workers are supported.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1994755</commentid>
    <comment_count>3</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-11-25 13:39:40 -0800</bug_when>
    <thetext>(In reply to Alexey Proskuryakov from comment #2)
&gt; Does it work when exposed? We do support nested workers, but I&apos;m not sure if
&gt; it automatically means that workers inside shared workers are supported.

Yes, it compiles and progress above mentioned two WPT test cases.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1994782</commentid>
    <comment_count>4</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2023-11-25 19:58:48 -0800</bug_when>
    <thetext>(In reply to Ahmad Saleem from comment #3)
&gt; (In reply to Alexey Proskuryakov from comment #2)
&gt; &gt; Does it work when exposed? We do support nested workers, but I&apos;m not sure if
&gt; &gt; it automatically means that workers inside shared workers are supported.
&gt; 
&gt; Yes, it compiles and progress above mentioned two WPT test cases.

It should in theory just work if we expose it. Please upload a PR if you can.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1994810</commentid>
    <comment_count>5</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-11-26 05:01:04 -0800</bug_when>
    <thetext>PR Attempt (Draft) - https://github.com/WebKit/WebKit/pull/20902</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1995677</commentid>
    <comment_count>6</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-11-29 12:24:14 -0800</bug_when>
    <thetext>&lt;rdar://problem/118945089&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1996085</commentid>
    <comment_count>7</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-11-30 17:55:56 -0800</bug_when>
    <thetext>This change leads to consistent crash in &apos;debug&apos; build on following test:

imported/w3c/web-platform-tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/nested-sharedworker-success.https.html

Crash log: https://ews-build.s3-us-west-2.amazonaws.com/macOS-AppleSilicon-Sonoma-Debug-WK2-Tests-EWS/e035bd8d-3120/imported/w3c/web-platform-tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/nested-sharedworker-success.https-crash-log.txt

No crash log found for WebKitTestRunner:20478.

stdout:

stderr:
ASSERTION FAILED: RunLoop::isMain()
/Volumes/Data/worker/macOS-AppleSilicon-Sonoma-Debug-Build-EWS/build/Source/WebKit/WebProcess/WebProcess.cpp(1183) : NetworkProcessConnection &amp;WebKit::WebProcess::ensureNetworkProcessConnection()
1   0x137dfd248 WTFCrash
2   0x11e725cd0 std::__1::span&lt;unsigned char const, 18446744073709551615ul&gt;::span[abi:v160006]&lt;unsigned char const*&gt;(unsigned char const*, unsigned long)
3   0x120904afc WebKit::WebProcess::ensureNetworkProcessConnection()
4   0x120d24b70 WebKit::WebLoaderStrategy::addOnlineStateChangeListener(WTF::Function&lt;void (bool)&gt;&amp;&amp;)
5   0x285c461a8 WebCore::Worker::Worker(WebCore::ScriptExecutionContext&amp;, JSC::RuntimeFlags, WebCore::WorkerOptions&amp;&amp;)
6   0x285c463b8 WebCore::Worker::Worker(WebCore::ScriptExecutionContext&amp;, JSC::RuntimeFlags, WebCore::WorkerOptions&amp;&amp;)
7   0x285c46434 WebCore::Worker::create(WebCore::ScriptExecutionContext&amp;, JSC::RuntimeFlags, WTF::String const&amp;, WebCore::WorkerOptions&amp;&amp;)
8   0x281fa87cc WebCore::JSDOMConstructor&lt;WebCore::JSWorker&gt;::construct(JSC::JSGlobalObject*, JSC::CallFrame*)
9   0x2a4e54270 8   ???                                 0x00000002a4e54270 0x0 + 11356422768
10  0x1384f37c4 llint_entry
11  0x1384f4838 llint_entry
12  0x1384f32ac llint_entry
13  0x1384f32ac llint_entry
14  0x1384f37c4 llint_entry
15  0x1384f32ac llint_entry
16  0x1384ccfb4 vmEntryToJavaScript
17  0x13965b5fc JSC::Interpreter::executeCallImpl(JSC::VM&amp;, JSC::JSObject*, JSC::CallData const&amp;, JSC::JSValue, JSC::ArgList const&amp;)
18  0x13965b6ec JSC::Interpreter::executeCall(JSC::JSObject*, JSC::CallData const&amp;, JSC::JSValue, JSC::ArgList const&amp;)
19  0x1398ead38 JSC::call(JSC::JSGlobalObject*, JSC::JSValue, JSC::CallData const&amp;, JSC::JSValue, JSC::ArgList const&amp;)
20  0x1398eaff8 JSC::profiledCall(JSC::JSGlobalObject*, JSC::ProfilingReason, JSC::JSValue, JSC::CallData const&amp;, JSC::JSValue, JSC::ArgList const&amp;)
21  0x139b4e278 JSC::runJSMicrotask(JSC::JSGlobalObject*, WTF::ObjectIdentifierGeneric&lt;JSC::MicrotaskIdentifierType, WTF::ObjectIdentifierThreadSafeAccessTraits&gt;, JSC::JSValue, JSC::JSValue, JSC::JSValue, JSC::JSValue, JSC::JSValue)
22  0x139b4e424 JSC::JSMicrotask::run(JSC::JSGlobalObject*)
23  0x283150a74 WebCore::JSExecState::runTask(JSC::JSGlobalObject*, JSC::Microtask&amp;)
24  0x28328ef28 WebCore::JSMicrotaskCallback::call()
25  0x28328eea8 WebCore::JSWorkerGlobalScopeBase::queueMicrotaskToEventLoop(JSC::JSGlobalObject&amp;, WTF::Ref&lt;JSC::Microtask, WTF::RawPtrTraits&lt;JSC::Microtask&gt;&gt;&amp;&amp;)::$_3::operator()()
26  0x28328ee04 WTF::Detail::CallableWrapper&lt;WebCore::JSWorkerGlobalScopeBase::queueMicrotaskToEventLoop(JSC::JSGlobalObject&amp;, WTF::Ref&lt;JSC::Microtask, WTF::RawPtrTraits&lt;JSC::Microtask&gt;&gt;&amp;&amp;)::$_3, void&gt;::call()
27  0x2800260e8 WTF::Function&lt;void ()&gt;::operator()() const
28  0x283ab0aec WebCore::EventLoopFunctionDispatchTask::execute()
29  0x283b155c0 WebCore::MicrotaskQueue::performMicrotaskCheckpoint()
30  0x283aa77a4 WebCore::EventLoop::performMicrotaskCheckpoint()
31  0x283aa9f40 WebCore::EventLoopTaskGroup::performMicrotaskCheckpoint()

&gt; I think I should close my PR or change to draft till figure out, what could be the reason of above &apos;assertion&apos;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1996088</commentid>
    <comment_count>8</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-11-30 17:58:09 -0800</bug_when>
    <thetext>Although if I look into &apos;WebProcess.cpp&apos;, we only have this as &apos;RELEASE_ASSERT&apos; except here:

https://searchfox.org/wubkat/rev/1531d41a4ef64103835343c7ca448db7defee9de/Source/WebKit/WebProcess/WebProcess.cpp#2139

which is behind:

#if HAVE(DISPLAY_LINK)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2163932</commentid>
    <comment_count>9</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2025-12-06 16:35:18 -0800</bug_when>
    <thetext>We get this assertion now:

ASSERTION FAILED: m_thread.ptr() == &amp;Thread::currentSingleton()
/Users/ahmadsaleem/OpenSource/WebKitBuild/Debug/usr/local/include/wtf/SingleThreadIntegralWrapper.h(54) : void WTF::SingleThreadIntegralWrapper&lt;unsigned int&gt;::assertThread() const [IntegralType = unsigned int]
1   0x30004e234 WTF::SingleThreadIntegralWrapper&lt;unsigned int&gt;::assertThread() const
2   0x30004e1a8 WTF::SingleThreadIntegralWrapper&lt;unsigned int&gt;::operator++()
3   0x30004e17c WTF::CanMakeCheckedPtrBase&lt;WTF::SingleThreadIntegralWrapper&lt;unsigned int&gt;, unsigned int, bool, (WTF::CheckedPtrDeleteCheckException)0&gt;::incrementCheckedPtrCount() const
4   0x3071f1de0 WTF::CheckedPtr&lt;WebCore::LoaderStrategy, WTF::RawPtrTraits&lt;WebCore::LoaderStrategy&gt;&gt;::refIfNotNull()
5   0x3071f1e5c WTF::CheckedPtr&lt;WebCore::LoaderStrategy, WTF::RawPtrTraits&lt;WebCore::LoaderStrategy&gt;&gt;::CheckedPtr(WTF::CheckedPtr&lt;WebCore::LoaderStrategy, WTF::RawPtrTraits&lt;WebCore::LoaderStrategy&gt;&gt; const&amp;)
6   0x3071f0094 WTF::CheckedPtr&lt;WebCore::LoaderStrategy, WTF::RawPtrTraits&lt;WebCore::LoaderStrategy&gt;&gt;::CheckedPtr(WTF::CheckedPtr&lt;WebCore::LoaderStrategy, WTF::RawPtrTraits&lt;WebCore::LoaderStrategy&gt;&gt; const&amp;)
7   0x3071effdc WebCore::PlatformStrategies::loaderStrategy()
8   0x308ae448c WebCore::Worker::Worker(WebCore::ScriptExecutionContext&amp;, JSC::RuntimeFlags, WebCore::WorkerOptions&amp;&amp;)
9   0x308ae4710 WebCore::Worker::Worker(WebCore::ScriptExecutionContext&amp;, JSC::RuntimeFlags, WebCore::WorkerOptions&amp;&amp;)
10  0x308ae4824 WebCore::Worker::create(WebCore::ScriptExecutionContext&amp;, JSC::RuntimeFlags, mpark::variant&lt;WTF::RefPtr&lt;WebCore::TrustedScriptURL, WTF::RawPtrTraits&lt;WebCore::TrustedScriptURL&gt;, WTF::DefaultRefDerefTraits&lt;WebCore::TrustedScriptURL&gt;&gt;, WTF::String&gt;&amp;&amp;, WebCore::WorkerOptions&amp;&amp;)
11  0x303012b6c WebCore::JSDOMConstructor&lt;WebCore::JSWorker&gt;::construct(JSC::JSGlobalObject*, JSC::CallFrame*)
12  0x13d070538 11  ???                                 0x000000013d070538 0x0 + 5318837560
13  0x13d0380c8 12  ???                                 0x000000013d0380c8 0x0 + 5318607048
14  0x13d038248 13  ???                                 0x000000013d038248 0x0 + 5318607432
15  0x13d038008 14  ???                                 0x000000013d038008 0x0 + 5318606856
16  0x13d038068 15  ???                                 0x000000013d038068 0x0 + 5318606952
17  0x13d0380c8 16  ???                                 0x000000013d0380c8 0x0 + 5318607048
18  0x13d038428 17  ???                                 0x000000013d038428 0x0 + 5318607912
19  0x1325cdde8 JSC::Interpreter::executeCallImpl(JSC::VM&amp;, JSC::JSObject*, JSC::CallData const&amp;, JSC::JSValue, JSC::JSCell*, JSC::ArgList const&amp;)
20  0x1325cdf34 JSC::Interpreter::executeCall(JSC::JSObject*, JSC::CallData const&amp;, JSC::JSValue, JSC::JSCell*, JSC::ArgList const&amp;)
21  0x1328ec174 JSC::callMicrotask(JSC::JSGlobalObject*, JSC::JSValue, JSC::JSValue, JSC::JSCell*, JSC::ArgList const&amp;, WTF::ASCIILiteral)
22  0x132be70ec JSC::runInternalMicrotask(JSC::JSGlobalObject*, JSC::InternalMicrotask, std::__1::span&lt;JSC::JSValue const, 4ul&gt;)
23  0x305c6057c WebCore::MicrotaskQueue::runJSMicrotask(JSC::JSGlobalObject*, JSC::VM&amp;, JSC::QueuedTask&amp;)
24  0x305c80fc8 WebCore::MicrotaskQueue::performMicrotaskCheckpoint()::$_0::operator()(JSC::QueuedTask&amp;) const
25  0x305c60abc void JSC::MicrotaskQueue::performMicrotaskCheckpoint&lt;false, WebCore::MicrotaskQueue::performMicrotaskCheckpoint()::$_0&gt;(JSC::VM&amp;, WebCore::MicrotaskQueue::performMicrotaskCheckpoint()::$_0 const&amp;)
26  0x305c607a8 WebCore::MicrotaskQueue::performMicrotaskCheckpoint()
27  0x305bd514c WebCore::EventLoop::performMicrotaskCheckpoint()
28  0x305bd8234 WebCore::EventLoopTaskGroup::performMicrotaskCheckpoint()
29  0x304b9e6c4 WebCore::JSExecState::didLeaveScriptContext(JSC::JSGlobalObject*)
30  0x304bd1034 WebCore::JSExecState::~JSExecState()
31  0x304b9ea88 WebCore::JSExecState::~JSExecState()</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2205128</commentid>
    <comment_count>10</comment_count>
    <who name="Anne van Kesteren">annevk</who>
    <bug_when>2026-04-27 14:58:34 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/63747</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2207093</commentid>
    <comment_count>11</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2026-05-03 22:50:59 -0700</bug_when>
    <thetext>Committed 312503@main (343451670f38): &lt;https://commits.webkit.org/312503@main&gt;

Reviewed commits have been landed. Closing PR #63747 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>