<?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>270894</bug_id>
          
          <creation_ts>2024-03-12 20:39:25 -0700</creation_ts>
          <short_desc>[MSE in Worker] ASSERT(canSafelyBeUsed());</short_desc>
          <delta_ts>2024-03-14 10:14:59 -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>Media</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</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>264134</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Jean-Yves Avenard [:jya]">jean-yves.avenard</reporter>
          <assigned_to name="Jean-Yves Avenard [:jya]">jean-yves.avenard</assigned_to>
          <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2020642</commentid>
    <comment_count>0</comment_count>
    <who name="Jean-Yves Avenard [:jya]">jean-yves.avenard</who>
    <bug_when>2024-03-12 20:39:25 -0700</bug_when>
    <thetext>running https://jyavenard.github.io/mse-in-workers-demo/mse-in-workers-demo.html can cause an assertion when clicking on &quot;stop&quot; button while playback is running.

```
* thread #12, name = &apos;WebCore: Worker&apos;, stop reason = EXC_BAD_ACCESS (code=1, address=0xbbadbeef)
    frame #0: 0x000000013b3155d8 JavaScriptCore`::WTFCrash() at Assertions.cpp:351:35
    frame #1: 0x0000000303596fb4 WebCore`WTFCrashWithInfo((null)=110, (null)=&quot;/Users/jyavenard/Work/webkit/OpenSource/WebKitBuild/Debug/usr/local/include/wtf/WeakPtr.h&quot;, (null)=&quot;T *WTF::WeakPtr&lt;WebCore::HTMLMediaElement&gt;::operator-&gt;() const [T = WebCore::HTMLMediaElement, WeakPtrImpl = WTF::DefaultWeakPtrImpl, PtrTraits = WTF::RawPtrTraits&lt;WTF::DefaultWeakPtrImpl&gt;]&quot;, (null)=323) at Assertions.h:780:5
    frame #2: 0x0000000302c495a0 WebCore`WTF::WeakPtr&lt;WebCore::HTMLMediaElement, WTF::DefaultWeakPtrImpl, WTF::RawPtrTraits&lt;WTF::DefaultWeakPtrImpl&gt;&gt;::operator-&gt;(this=0x00000001160525b0) const at WeakPtr.h:110:9
  * frame #3: 0x0000000302c95f74 WebCore`WebCore::MediaSource::stop(this=0x0000000116052520) at MediaSource.cpp:1254:9
    frame #4: 0x00000003041ee52c WebCore`auto WebCore::ScriptExecutionContext::stopActiveDOMObjects()::$_9::operator()&lt;WebCore::ActiveDOMObject&gt;(this=0x0000000113abc2f8, activeDOMObject=0x0000000116052520) const at ScriptExecutionContext.cpp:396:25
    frame #5: 0x00000003041ee4a8 WebCore`WTF::Detail::CallableWrapper&lt;WebCore::ScriptExecutionContext::stopActiveDOMObjects()::$_9, WebCore::ScriptExecutionContext::ShouldContinue, WebCore::ActiveDOMObject&amp;&gt;::call(this=0x0000000113abc2f0, in=0x0000000116052520) at Function.h:53:39
    frame #6: 0x00000003041cbe38 WebCore`WTF::Function&lt;WebCore::ScriptExecutionContext::ShouldContinue (WebCore::ActiveDOMObject&amp;)&gt;::operator()(this=0x000000016fd52ab0, in=0x0000000116052520) const at Function.h:82:35
    frame #7: 0x00000003041cbc68 WebCore`WebCore::ScriptExecutionContext::forEachActiveDOMObject(this=0x0000000116042b20, apply=0x000000016fd52ab0) const at ScriptExecutionContext.cpp:301:13
    frame #8: 0x00000003041cc5c4 WebCore`WebCore::ScriptExecutionContext::stopActiveDOMObjects(this=0x0000000116042b20) at ScriptExecutionContext.cpp:395:5
    frame #9: 0x0000000306612524 WebCore`WebCore::WorkerOrWorkletGlobalScope::prepareForDestruction(this=0x0000000116042b20) at WorkerOrWorkletGlobalScope.cpp:65:5
    frame #10: 0x0000000306612358 WebCore`WebCore::WorkerGlobalScope::prepareForDestruction(this=0x0000000116042b20) at WorkerGlobalScope.cpp:159:33
    frame #11: 0x00000003065fabc0 WebCore`WebCore::DedicatedWorkerGlobalScope::prepareForDestruction(this=0x0000000116042b20) at DedicatedWorkerGlobalScope.cpp:89:24
    frame #12: 0x000000030665fdf8 WebCore`WebCore::WorkerOrWorkletThread::stop(WTF::Function&lt;void ()&gt;&amp;&amp;)::$_7::operator()(this=0x0000000113cb88a8, context=0x0000000116042b20) const at WorkerOrWorkletThread.cpp:302:25
    frame #13: 0x000000030665fd64 WebCore`WTF::Detail::CallableWrapper&lt;WebCore::WorkerOrWorkletThread::stop(WTF::Function&lt;void ()&gt;&amp;&amp;)::$_7, void, WebCore::ScriptExecutionContext&amp;&gt;::call(this=0x0000000113cb88a0, in=0x0000000116042b20) at Function.h:53:39
    frame #14: 0x00000003027f32a4 WebCore`WTF::Function&lt;void (WebCore::ScriptExecutionContext&amp;)&gt;::operator()(this=0x0000000113c21280, in=0x0000000116042b20) const at Function.h:82:35
    frame #15: 0x00000003031c2868 WebCore`WebCore::ScriptExecutionContext::Task::performTask(this=0x0000000113c21280, context=0x0000000116042b20) at ScriptExecutionContext.h:233:61
    frame #16: 0x000000030664af64 WebCore`WebCore::WorkerDedicatedRunLoop::Task::performTask(this=0x0000000113c21280, context=0x0000000116042b20) at WorkerRunLoop.cpp:285:16
    frame #17: 0x000000030664a6fc WebCore`WebCore::WorkerDedicatedRunLoop::runCleanupTasks(this=0x00000001133cbba0, context=0x0000000116042b20) at WorkerRunLoop.cpp:253:15
    frame #18: 0x000000030664886c WebCore`WebCore::WorkerDedicatedRunLoop::run(this=0x00000001133cbba0, context=0x0000000116042b20) at WorkerRunLoop.cpp:158:5
    frame #19: 0x0000000306648774 WebCore`WebCore::WorkerOrWorkletThread::runEventLoop(this=0x0000000113294100) at WorkerOrWorkletThread.cpp:113:18
    frame #20: 0x0000000306648c40 WebCore`WebCore::WorkerOrWorkletThread::workerOrWorkletThread(this=0x0000000113294100) at WorkerOrWorkletThread.cpp:187:5
    frame #21: 0x000000030666e4f8 WebCore`WebCore::WorkerThread::createThread()::$_18::operator()(this=0x00000001135a6868) const at WorkerThread.cpp:127:9
    frame #22: 0x000000030666e49c WebCore`WTF::Detail::CallableWrapper&lt;WebCore::WorkerThread::createThread()::$_18, void&gt;::call(this=0x00000001135a6860) at Function.h:53:39
    frame #23: 0x000000013d2533dc JavaScriptCore`WTF::Function&lt;void ()&gt;::operator()(this=0x000000016fd52f90) const at Function.h:82:35
    frame #24: 0x000000013b445bbc JavaScriptCore`WTF::Thread::entryPoint(newThreadContext=0x000000011385ab80) at Threading.cpp:258:5
    frame #25: 0x000000013b452e14 JavaScriptCore`WTF::wtfThreadEntryPoint(context=0x000000011385ab80) at ThreadingPOSIX.cpp:247:5
    frame #26: 0x000000019d4faf94 libsystem_pthread.dylib`_pthread_start + 136
```</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2020643</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2024-03-12 20:40:36 -0700</bug_when>
    <thetext>&lt;rdar://problem/124500515&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2020646</commentid>
    <comment_count>2</comment_count>
    <who name="Jean-Yves Avenard [:jya]">jean-yves.avenard</who>
    <bug_when>2024-03-12 20:47:29 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/25806</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2021041</commentid>
    <comment_count>3</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2024-03-14 10:14:57 -0700</bug_when>
    <thetext>Committed 276100@main (dd8b32e43a1a): &lt;https://commits.webkit.org/276100@main&gt;

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

    </bug>

</bugzilla>