<?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>304834</bug_id>
          
          <creation_ts>2026-01-01 17:19:16 -0800</creation_ts>
          <short_desc>REGRESSION(274853@main): nullopt dereference of m_seekTargetPromise in MediaSource::waitForTarget for imported/w3c/web-platform-tests/media-source/mediasource-seek-beyond-duration.html</short_desc>
          <delta_ts>2026-01-05 02:32:12 -0800</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>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=269461</see_also>
          <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>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Fujii Hironori">fujii</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>jean-yves.avenard</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2168837</commentid>
    <comment_count>0</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2026-01-01 17:19:16 -0800</bug_when>
    <thetext>REGRESSION(274853@main): nullopt dereference of m_seekTargetPromise in MediaSource::waitForTarget for imported/w3c/web-platform-tests/media-source/mediasource-seek-beyond-duration.html

History: https://results.webkit.org/?suite=layout-tests&amp;test=imported%2Fw3c%2Fweb-platform-tests%2Fmedia-source%2Fmediasource-seek-beyond-duration.html

https://build.webkit.org/results/GTK-Linux-64-bit-Debug-Tests/304985@main%20(17781)/imported/w3c/web-platform-tests/media-source/mediasource-seek-beyond-duration-crash-log.txt

Thread 1 (Thread 0x7f6abc796ec0 (LWP 3751308)):
#0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=&lt;optimized out&gt;) at ./nptl/pthread_kill.c:44
#1  __pthread_kill_internal (signo=6, threadid=&lt;optimized out&gt;) at ./nptl/pthread_kill.c:78
#2  __GI___pthread_kill (threadid=&lt;optimized out&gt;, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
#3  0x00007f6acae3327e in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#4  0x00007f6acae168ff in __GI_abort () at ./stdlib/abort.c:79
#5  0x00007f6ac0d6190d in std::__glibcxx_assert_fail(char const*, int, char const*, char const*) () at /lib/x86_64-linux-gnu/libstdc++.so.6
#6  0x00007f6adefc5a89 in std::_Optional_base_impl&lt;WTF::NativePromiseProducer&lt;WTF::MediaTime, WebCore::PlatformMediaError, 16u&gt;, std::_Optional_base&lt;WTF::NativePromiseProducer&lt;WTF::MediaTime, WebCore::PlatformMediaError, 16u&gt;, false, false&gt; &gt;::_M_get (this=0x7f6ab2404b40) at /usr/include/c++/13/optional:479
#7  0x00007f6adefbf512 in std::optional&lt;WTF::NativePromiseProducer&lt;WTF::MediaTime, WebCore::PlatformMediaError, 16u&gt; &gt;::operator-&gt; (this=0x7f6ab2404b40) at /usr/include/c++/13/optional:968
#8  0x00007f6adefb5d7a in WebCore::MediaSource::waitForTarget (this=0x7f6ab2404a60, target=...) at ../../../Source/WebCore/Modules/mediasource/MediaSource.cpp:409
#9  0x00007f6adefb4077 in WebCore::MediaSourceClientImpl::waitForTarget(WebCore::SeekTarget const&amp;)::{lambda(WebCore::MediaSource&amp;)#1}::operator()(WebCore::MediaSource&amp;) (__closure=0x7f6ab2403608, parent=...) at ../../../Source/WebCore/Modules/mediasource/MediaSource.cpp:163
#10 0x00007f6adefef2f2 in WTF::Detail::CallableWrapper&lt;WebCore::MediaSourceClientImpl::waitForTarget(WebCore::SeekTarget const&amp;)::{lambda(WebCore::MediaSource&amp;)#1}, void, WebCore::MediaSource&amp;&gt;::call(WebCore::MediaSource&amp;) (this=0x7f6ab2403600, in#0=...) at WTF/Headers/wtf/Function.h:59
#11 0x00007f6adefbded1 in WTF::Function&lt;void (WebCore::MediaSource&amp;)&gt;::operator()(WebCore::MediaSource&amp;) const (this=0x7f6ab2364b48, in#0=...) at WTF/Headers/wtf/Function.h:103
#12 0x00007f6adefb3a54 in WebCore::MediaSourceClientImpl::ensureWeakOnDispatcher(WTF::Function&lt;void (WebCore::MediaSource&amp;)&gt;&amp;&amp;, bool) const::{lambda()#1}::operator()() const (__closure=0x7f6ab2364b48) at ../../../Source/WebCore/Modules/mediasource/MediaSource.cpp:119
#13 0x00007f6adefee16e in WebCore::MediaSourceClientImpl::ensureWeakOnDispatcher(WTF::Function&lt;void (WebCore::MediaSource&amp;)&gt;&amp;&amp;, bool) const::{lambda(auto:1&amp;)#1}::operator()&lt;WebCore::ScriptExecutionContext&gt;(WebCore::ScriptExecutionContext&amp;) const (__closure=0x7f6ab2364b48) at ../../../Source/WebCore/Modules/mediasource/MediaSource.cpp:122
#14 0x00007f6adefee1a6 in WTF::Detail::CallableWrapper&lt;WebCore::MediaSourceClientImpl::ensureWeakOnDispatcher(WTF::Function&lt;void (WebCore::MediaSource&amp;)&gt;&amp;&amp;, bool) const::{lambda(auto:1&amp;)#1}, void, WebCore::ScriptExecutionContext&amp;&gt;::call(WebCore::ScriptExecutionContext&amp;) (this=0x7f6ab2364b40, in#0=...) at WTF/Headers/wtf/Function.h:59
#15 0x00007f6adec03759 in WTF::Function&lt;void (WebCore::ScriptExecutionContext&amp;)&gt;::operator()(WebCore::ScriptExecutionContext&amp;) const (this=0x7ffef6d4ba00, in#0=...) at WTF/Headers/wtf/Function.h:103
#16 0x00007f6adf5e82ad in WebCore::ScriptExecutionContext::Task::performTask (this=0x7ffef6d4ba00, context=...) at WebCore/PrivateHeaders/WebCore/ScriptExecutionContext.h:279
#17 0x00007f6ae0e317f1 in WebCore::ScriptExecutionContext::ensureOnContextThread (identifier=..., task=...) at ../../../Source/WebCore/dom/ScriptExecutionContext.cpp:808
#18 0x00007f6adefb3d1e in WebCore::MediaSourceClientImpl::ensureWeakOnDispatcher(WTF::Function&lt;void (WebCore::MediaSource&amp;)&gt;&amp;&amp;, bool) const (this=0x7f6ab23578a0, function=..., forceRun=false) at ../../../Source/WebCore/Modules/mediasource/MediaSource.cpp:121
#19 0x00007f6adefb428a in WebCore::MediaSourceClientImpl::waitForTarget (this=0x7f6ab23578a0, target=...) at ../../../Source/WebCore/Modules/mediasource/MediaSource.cpp:162
#20 0x00007f6ae249e4f0 in WebCore::MediaSourcePrivate::waitForTarget (this=0x7f6ab2384960, target=...) at ../../../Source/WebCore/platform/graphics/MediaSourcePrivate.cpp:103
#21 0x00007f6ae2790a61 in WebCore::MediaPlayerPrivateGStreamerMSE::doSeek (this=0x7f6ab000c000, target=..., rate=1, isAsync=false, isSegment=false) at ../../../Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:314
#22 0x00007f6ae278fdeb in WebCore::MediaPlayerPrivateGStreamerMSE::seekToTarget (this=0x7f6ab000c000, target=...) at ../../../Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:247
#23 0x00007f6ae2479da5 in WebCore::MediaPlayer::seekToTarget (this=0x7f6ab223e080, target=...) at ../../../Source/WebCore/platform/graphics/MediaPlayer.cpp:864
#24 0x00007f6ae122fe26 in WebCore::HTMLMediaElement::seekTask (this=0x7f6ab0222800) at ../../../Source/WebCore/html/HTMLMediaElement.cpp:4040
#25 0x00007f6ae125fea0 in operator()&lt;WebCore::HTMLMediaElement&gt; (__closure=0x7f6ab261b348, element=warning: RTTI symbol not found for class &apos;WebCore::HTMLVideoElement&apos;
...) at ../../../Source/WebCore/html/HTMLMediaElement.cpp:3941
#26 0x00007f6ae125fed0 in operator() (__closure=0x7f6ab261b348) at WebCore/PrivateHeaders/WebCore/ActiveDOMObject.h:123
#27 0x00007f6ae12c9a80 in WTF::Detail::CallableWrapper&lt;WebCore::ActiveDOMObject::queueCancellableTaskKeepingObjectAlive&lt;WebCore::HTMLMediaElement, WebCore::HTMLMediaElement::seekWithTolerance(const WebCore::SeekTarget&amp;, bool)::&lt;lambda(auto:614&amp;)&gt; &gt;(WebCore::HTMLMediaElement&amp;, WebCore::TaskSource, WTF::TaskCancellationGroup&amp;, WebCore::HTMLMediaElement::seekWithTolerance(const WebCore::SeekTarget&amp;, bool)::&lt;lambda(auto:614&amp;)&gt;&amp;&amp;)::&lt;lambda()&gt;, void&gt;::call(void) (this=0x7f6ab261b340) at WTF/Headers/wtf/Function.h:59
#28 0x00007f6ad9039f7d in WTF::Function&lt;void ()&gt;::operator()() const (this=0x7f6ab23649b0) at WTF/Headers/wtf/Function.h:103
#29 0x00007f6adf89f8fa in WTF::CancellableTask::operator() (this=0x7f6ab23649a0) at WTF/Headers/wtf/CancellableTask.h:100
#30 0x00007f6ae125ff14 in operator() (__closure=0x7f6ab2364998) at WebCore/PrivateHeaders/WebCore/ActiveDOMObject.h:128
#31 0x00007f6ae12c9a5c in WTF::Detail::CallableWrapper&lt;WebCore::ActiveDOMObject::queueCancellableTaskKeepingObjectAlive&lt;WebCore::HTMLMediaElement, WebCore::HTMLMediaElement::seekWithTolerance(const WebCore::SeekTarget&amp;, bool)::&lt;lambda(auto:614&amp;)&gt; &gt;(WebCore::HTMLMediaElement&amp;, WebCore::TaskSource, WTF::TaskCancellationGroup&amp;, WebCore::HTMLMediaElement::seekWithTolerance(const WebCore::SeekTarget&amp;, bool)::&lt;lambda(auto:614&amp;)&gt;&amp;&amp;)::&lt;lambda()&gt;, void&gt;::call(void) (this=0x7f6ab2364990) at WTF/Headers/wtf/Function.h:59
#32 0x00007f6ad9039f7d in WTF::Function&lt;void ()&gt;::operator()() const (this=0x7f6ab23649e0) at WTF/Headers/wtf/Function.h:103
#33 0x00007f6ae0d0c6bc in WebCore::EventLoopFunctionDispatchTask::execute (this=0x7f6ab23649c0) at ../../../Source/WebCore/dom/EventLoop.cpp:551
#34 0x00007f6ae0d0b04e in WebCore::EventLoop::run (this=0x7f6ab21d6e00, deadline=std::optional = {...}) at ../../../Source/WebCore/dom/EventLoop.cpp:337
#35 0x00007f6ae0f099ad in WebCore::WindowEventLoop::didReachTimeToRun (this=0x7f6ab21d6e00) at ../../../Source/WebCore/dom/WindowEventLoop.cpp:233
#36 0x00007f6ae0f0e010 in WebCore::Timer::Timer&lt;WebCore::WindowEventLoop, WebCore::WindowEventLoop&gt;(WebCore::WindowEventLoop&amp;, void (WebCore::WindowEventLoop::*)())::{lambda()#1}::operator()() const (__closure=0x7f6ab21c8758) at WebCore/PrivateHeaders/WebCore/Timer.h:167
#37 0x00007f6ae0f21618 in WTF::Detail::CallableWrapper&lt;WebCore::Timer::Timer&lt;WebCore::WindowEventLoop, WebCore::WindowEventLoop&gt;(WebCore::WindowEventLoop&amp;, void (WebCore::WindowEventLoop::*)())::{lambda()#1}, void&gt;::call() (this=0x7f6ab21c8750) at WTF/Headers/wtf/Function.h:59
#38 0x00007f6ad9039f7d in WTF::Function&lt;void ()&gt;::operator()() const (this=0x7f6ab21d6f58) at WTF/Headers/wtf/Function.h:103
#39 0x00007f6ada0b35f4 in WebCore::Timer::fired (this=0x7f6ab21d6f20) at WebCore/PrivateHeaders/WebCore/Timer.h:189
#40 0x00007f6ae217afe5 in WebCore::ThreadTimers::sharedTimerFiredInternal (this=0x7f6ab20d9a40) at ../../../Source/WebCore/platform/ThreadTimers.cpp:138
#41 0x00007f6ae217a7c9 in operator() (__closure=0x7f6ab20017e8) at ../../../Source/WebCore/platform/ThreadTimers.cpp:74
#42 0x00007f6ae218d0c6 in WTF::Detail::CallableWrapper&lt;WebCore::ThreadTimers::setSharedTimer(WebCore::SharedTimer*)::&lt;lambda()&gt;, void&gt;::call(void) (this=0x7f6ab20017e0) at WTF/Headers/wtf/Function.h:59
#43 0x00007f6ad9039f7d in WTF::Function&lt;void ()&gt;::operator()() const (this=0x7f6ae57bacb0 &lt;WebCore::MainThreadSharedTimer::singleton()::instance+48&gt;) at WTF/Headers/wtf/Function.h:103
#44 0x00007f6ae210ec58 in WebCore::MainThreadSharedTimer::fired (this=0x7f6ae57bac80 &lt;WebCore::MainThreadSharedTimer::singleton()::instance&gt;) at ../../../Source/WebCore/platform/MainThreadSharedTimer.cpp:85
#45 0x00007f6ae2110d68 in WTF::RunLoop::Timer::Timer&lt;WebCore::MainThreadSharedTimer&gt;(WTF::Ref&lt;WTF::RunLoop, WTF::RawPtrTraits&lt;WTF::RunLoop&gt;, WTF::DefaultRefDerefTraits&lt;WTF::RunLoop&gt; &gt;&amp;&amp;, WTF::ASCIILiteral, WebCore::MainThreadSharedTimer*, void (WebCore::MainThreadSharedTimer::*)())::{lambda()#1}::operator()() const (__closure=0x7f6ab20d9a78) at WTF/Headers/wtf/RunLoop.h:220
#46 0x00007f6ae2116922 in WTF::Detail::CallableWrapper&lt;WTF::RunLoop::Timer::Timer&lt;WebCore::MainThreadSharedTimer&gt;(WTF::Ref&lt;WTF::RunLoop, WTF::RawPtrTraits&lt;WTF::RunLoop&gt;, WTF::DefaultRefDerefTraits&lt;WTF::RunLoop&gt; &gt;&amp;&amp;, WTF::ASCIILiteral, WebCore::MainThreadSharedTimer*, void (WebCore::MainThreadSharedTimer::*)())::{lambda()#1}, void&gt;::call() (this=0x7f6ab20d9a70) at WTF/Headers/wtf/Function.h:59
#47 0x00007f6ad9039f7d in WTF::Function&lt;void ()&gt;::operator()() const (this=0x7f6ae57bacf0 &lt;WebCore::MainThreadSharedTimer::singleton()::instance+112&gt;) at WTF/Headers/wtf/Function.h:103
#48 0x00007f6ada24472e in WTF::RunLoop::Timer::fired (this=0x7f6ae57bacb8 &lt;WebCore::MainThreadSharedTimer::singleton()::instance+56&gt;) at WTF/Headers/wtf/RunLoop.h:262
#49 0x00007f6ac9731b5f in operator() (__closure=0x0, userData=0x7f6ae57bacb8 &lt;WebCore::MainThreadSharedTimer::singleton()::instance+56&gt;) at ../../../Source/WTF/wtf/glib/RunLoopGLib.cpp:327
#50 0x00007f6ac9731ba3 in _FUN () at ../../../Source/WTF/wtf/glib/RunLoopGLib.cpp:331
#51 0x00007f6ac9730728 in operator() (__closure=0x0, source=0x558ca0ddaaa0, callback=0x7f6ac9731b82 &lt;_FUN(gpointer)&gt;, userData=0x7f6ae57bacb8 &lt;WebCore::MainThreadSharedTimer::singleton()::instance+56&gt;) at ../../../Source/WTF/wtf/glib/RunLoopGLib.cpp:115
#52 0x00007f6ac9730795 in _FUN () at ../../../Source/WTF/wtf/glib/RunLoopGLib.cpp:118
#53 0x00007f6ac3bc649e in ??? () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#54 0x00007f6ac3bc6710 in g_main_context_dispatch () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#55 0x00007f6ac9731119 in WTF::RunLoop::runGLibMainLoopIteration (this=0x7f6ab201c110, mayBlock=WTF::RunLoop::MayBlock::Yes) at ../../../Source/WTF/wtf/glib/RunLoopGLib.cpp:190
#56 0x00007f6ac9731188 in WTF::RunLoop::runGLibMainLoop (this=0x7f6ab201c110) at ../../../Source/WTF/wtf/glib/RunLoopGLib.cpp:199
#57 0x00007f6ac9731250 in WTF::RunLoop::run () at ../../../Source/WTF/wtf/glib/RunLoopGLib.cpp:212
#58 0x00007f6adbe0c3c2 in WebKit::AuxiliaryProcessMainBase&lt;WebKit::WebProcess, true&gt;::run (this=0x7ffef6d4c620, argc=4, argv=0x7ffef6d4c7e8) at ../../../Source/WebKit/Shared/AuxiliaryProcessMain.h:77
#59 0x00007f6adbe0ba45 in WebKit::AuxiliaryProcessMain&lt;WebKit::WebProcessMainGtk&gt; (argc=4, argv=0x7ffef6d4c7e8) at ../../../Source/WebKit/Shared/AuxiliaryProcessMain.h:103
#60 0x00007f6adbe0b1aa in WebKit::WebProcessMain (argc=4, argv=0x7ffef6d4c7e8) at ../../../Source/WebKit/WebProcess/gtk/WebProcessMainGtk.cpp:117
#61 0x0000558c8f4417ed in main (argc=4, argv=0x7ffef6d4c7e8) at ../../../Source/WebKit/WebProcess/EntryPoint/unix/WebProcessMain.cpp:31</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2168838</commentid>
    <comment_count>1</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2026-01-01 17:20:13 -0800</bug_when>
    <thetext>In MediaSource::waitForTarget, m_seekTargetPromise can be nullopt because above monitorSourceBuffers() may reset m_seekTargetPromise.
This code was added by bug#269461.

&gt;   407	        monitorSourceBuffers();
&gt;   408	
&gt;   409	        return m_seekTargetPromise-&gt;promise();

https://github.com/WebKit/WebKit/blob/283c780414b7c24e4a911c823af665f53a15e8f7/Source/WebCore/Modules/mediasource/MediaSource.cpp#L407-L409</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2168843</commentid>
    <comment_count>2</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2026-01-01 17:42:17 -0800</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/55991</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2169251</commentid>
    <comment_count>3</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2026-01-05 02:31:20 -0800</bug_when>
    <thetext>Committed 305103@main (7df9b18a84da): &lt;https://commits.webkit.org/305103@main&gt;

Reviewed commits have been landed. Closing PR #55991 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2169252</commentid>
    <comment_count>4</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2026-01-05 02:32:12 -0800</bug_when>
    <thetext>&lt;rdar://problem/167541932&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>