<?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>259280</bug_id>
          
          <creation_ts>2023-07-17 11:07:23 -0700</creation_ts>
          <short_desc>[GStreamer] UI process crash in MediaPlayerPrivateGStreamer::codecForStreamId</short_desc>
          <delta_ts>2023-07-18 10:03:25 -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>PC</rep_platform>
          <op_sys>Linux</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>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Catanzaro">mcatanzaro</reporter>
          <assigned_to name="Philippe Normand">philn</assigned_to>
          <cc>bugs-noreply</cc>
    
    <cc>mcatanzaro</cc>
    
    <cc>philn</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1967066</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2023-07-17 11:07:23 -0700</bug_when>
    <thetext>I hit this UI process crash randomly on the homepage of youtube.com. Notice the scary this=0x0 in frame 3 indicating we&apos;re calling methods of a destroyed MediaPlayerPrivateGStreamer:

(gdb) bt full
#0  WTF::HashTable&lt;WTF::String, WTF::KeyValuePair&lt;WTF::String, WTF::String&gt;, WTF::KeyValuePairKeyExtractor&lt;WTF::KeyValuePair&lt;WTF::String, WTF::String&gt; &gt;, WTF::DefaultHash&lt;WTF::String&gt;, WTF::HashMap&lt;WTF::String, WTF::String, WTF::DefaultHash&lt;WTF::String&gt;, WTF::HashTraits&lt;WTF::String&gt;, WTF::HashTraits&lt;WTF::String&gt;, WTF::HashTableTraits&gt;::KeyValuePairTraits, WTF::HashTraits&lt;WTF::String&gt; &gt;::contains&lt;WTF::IdentityHashTranslator&lt;WTF::HashMap&lt;WTF::String, WTF::String, WTF::DefaultHash&lt;WTF::String&gt;, WTF::HashTraits&lt;WTF::String&gt;, WTF::HashTraits&lt;WTF::String&gt;, WTF::HashTableTraits&gt;::KeyValuePairTraits, WTF::DefaultHash&lt;WTF::String&gt; &gt;, WTF::String&gt;(WTF::String const&amp;) const (this=0x3c8, key=&lt;optimized out&gt;)
    at WTF/Headers/wtf/HashTable.h:1039
#1  WTF::HashTable&lt;WTF::String, WTF::KeyValuePair&lt;WTF::String, WTF::String&gt;, WTF::KeyValuePairKeyExtractor&lt;WTF::KeyValuePair&lt;WTF::String, WTF::String&gt; &gt;, WTF::DefaultHash&lt;WTF::String&gt;, WTF::HashMap&lt;WTF::String, WTF::String, WTF::DefaultHash&lt;WTF::String&gt;, WTF::HashTraits&lt;WTF::String&gt;, WTF::HashTraits&lt;WTF::String&gt;, WTF::HashTableTraits&gt;::KeyValuePairTraits, WTF::HashTraits&lt;WTF::String&gt; &gt;::contains(WTF::String const&amp;) const (this=0x3c8, key=&lt;optimized out&gt;)
    at WTF/Headers/wtf/HashTable.h:489
#2  WTF::HashMap&lt;WTF::String, WTF::String, WTF::DefaultHash&lt;WTF::String&gt;, WTF::HashTraits&lt;WTF::String&gt;, WTF::HashTraits&lt;WTF::String&gt;, WTF::HashTableTraits&gt;::contains(WTF::String const&amp;) const (this=0x3c8, key=&lt;optimized out&gt;)
    at WTF/Headers/wtf/HashMap.h:323
#3  WebCore::MediaPlayerPrivateGStreamer::codecForStreamId(WTF::String const&amp;)
    (this=0x0, streamId=&quot;6bd23d7859548e56dbfcc7e408694057/001:001&quot;)
    at /buildstream/gnome/sdk/webkitgtk-6.0.bst/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:4443
#4  0x00007ff9ceaf1797 in WebCore::AudioTrackPrivateGStreamer::capsChanged(WTF::String const&amp;, WTF::GRefPtr&lt;_GstCaps&gt; const&amp;) (this=0x7ff9b2437600, streamId=&quot;6bd23d7859548e56dbfcc7e408694057/001:001&quot;, caps=&lt;optimized out&gt;)
    at /buildstream/gnome/sdk/webkitgtk-6.0.bst/Source/WebCore/platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp:86
        codec = Python Exception &lt;class &apos;gdb.MemoryError&apos;&gt;: Cannot access memory at address 0x3
#5  0x00007ff9ceb23b66 in WebCore::TrackPrivateBaseGStreamer::setPad(WTF::GRefPtr&lt;_GstPad&gt;&amp;&amp;)::$_0::operator()(_GstPad*, _GstPadProbeInfo*, WebCore::TrackPrivateBaseGStreamer*) const::{lambda()#1}::operator()() const
    (this=&lt;optimized out&gt;)
    at /buildstream/gnome/sdk/webkitgtk-6.0.bst/Source/WebCore/platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:136
        caps = &lt;optimized out&gt;
#6  WTF::Detail::CallableWrapper&lt;WebCore::TrackPrivateBaseGStreamer::setPad(WTF::GRefPtr&lt;_GstPad&gt;&amp;&amp;)::$_0::operator()(_GstPad*, _GstPadProbeInfo*, WebCore::TrackPrivateBaseGStreamer*) const::{lambda()#1}, void&gt;::call()
    (this=&lt;optimized out&gt;) at WTF/Headers/wtf/Function.h:53
#7  0x00007ff9cbab59fb in WTF::Function&lt;void ()&gt;::operator()() const (this=&lt;optimized out&gt;)
    at /buildstream/gnome/sdk/webkitgtk-6.0.bst/Source/WTF/wtf/Function.h:82
        function = {m_callableWrapper = std::unique_ptr&lt;WTF::Detail::CallableWrapperBase&lt;void&gt;&gt; = {get() = 0x7ff7f6a14100}}
        didSuspendFunctions = false
#8  WTF::RunLoop::performWork() (this=0x7ff9b20100e0)
    at /buildstream/gnome/sdk/webkitgtk-6.0.bst/Source/WTF/wtf/RunLoop.cpp:147
        function = {m_callableWrapper = std::unique_ptr&lt;WTF::Detail::CallableWrapperBase&lt;void&gt;&gt; = {get() = 0x7ff7f6a14100}}
        didSuspendFunctions = false
#9  0x00007ff9cbb149dd in WTF::RunLoop::RunLoop()::$_0::operator()(void*) const (userData=0x7ffe5b402888, 
    userData@entry=0x7ff9b20100e0, this=&lt;optimized out&gt;)
    at /buildstream/gnome/sdk/webkitgtk-6.0.bst/Source/WTF/wtf/glib/RunLoopGLib.cpp:80
#10 WTF::RunLoop::RunLoop()::$_0::__invoke(void*) (userData=0x7ffe5b402888)
    at /buildstream/gnome/sdk/webkitgtk-6.0.bst/Source/WTF/wtf/glib/RunLoopGLib.cpp:79
#11 0x00007ff9cbb13de1 in WTF::RunLoop::$_0::operator()(_GSource*, int (*)(void*), void*) const
    (source=0x564246804eb0, callback=0x7ff9cbb149d0 &lt;WTF::RunLoop::RunLoop()::$_0::__invoke(void*)&gt;, userData=0x7ff9b20100e0, this=&lt;optimized out&gt;) at /buildstream/gnome/sdk/webkitgtk-6.0.bst/Source/WTF/wtf/glib/RunLoopGLib.cpp:53
        name = 0x5642467bd7b0 &quot;[WebKit] RunLoop work&quot;
        runLoopSource = @0x564246804eb0: {source = {callback_data = 0x5642467e6da0, callback_funcs = 0x7ff9c85882e0 &lt;g_source_callback_funcs&gt;, source_funcs = 0x7ff9cbfb53d0 &lt;WTF::RunLoop::s_runLoopSourceFunctions&gt;, ref_count = 3, context = 0x5642467c4ab0, priority = 100, flags = 35, source_id = 2, poll_fds = 0x0, prev = 0x0, next = 0x564246962c30, name--Type &lt;RET&gt; for more, q to quit, c to continue without paging--c
 = 0x5642467bd7b0 &quot;[WebKit] RunLoop work&quot;, priv = 0x56424678b740}, runLoop = 0x7ff9b20100e0}
        returnValue = &lt;optimized out&gt;
#12 WTF::RunLoop::$_0::__invoke(_GSource*, int (*)(void*), void*)
    (source=0x564246804eb0, callback=0x7ff9cbb149d0 &lt;WTF::RunLoop::RunLoop()::$_0::__invoke(void*)&gt;, userData=0x7ff9b20100e0) at /buildstream/gnome/sdk/webkitgtk-6.0.bst/Source/WTF/wtf/glib/RunLoopGLib.cpp:45
#13 0x00007ff9c849ba47 in g_main_dispatch (context=context@entry=0x5642467c4ab0) at ../glib/gmain.c:3476
        dispatch = 0x7ff9cbb13d90 &lt;WTF::RunLoop::$_0::__invoke(_GSource*, int (*)(void*), void*)&gt;
        prev_source = 0x0
        begin_time_nsec = 16422526645309
        was_in_call = 0
        user_data = 0x7ff9b20100e0
        callback = 0x7ff9cbb149d0 &lt;WTF::RunLoop::RunLoop()::$_0::__invoke(void*)&gt;
        cb_funcs = 0x7ff9c85882e0 &lt;g_source_callback_funcs&gt;
        cb_data = 0x5642467e6da0
        need_destroy = &lt;optimized out&gt;
        source = 0x564246804eb0
        current = 0x5642467d6b60
        i = 0
        __func__ = &quot;g_main_dispatch&quot;
#14 0x00007ff9c849db57 in g_main_context_dispatch_unlocked (context=0x5642467c4ab0) at ../glib/gmain.c:4286
        max_priority = 100
        timeout = 0
        some_ready = 1
        nfds = 11
        allocated_nfds = &lt;optimized out&gt;
        fds = 0x56424708fa40
        begin_time_nsec = 16422526614170
#15 g_main_context_iterate_unlocked
    (context=0x5642467c4ab0, block=block@entry=1, dispatch=dispatch@entry=1, self=&lt;optimized out&gt;)
    at ../glib/gmain.c:4351
        max_priority = 100
        timeout = 0
        some_ready = 1
        nfds = 11
        allocated_nfds = &lt;optimized out&gt;
        fds = 0x56424708fa40
        begin_time_nsec = 16422526614170
#16 0x00007ff9c849e567 in g_main_loop_run (loop=0x564246804e00) at ../glib/gmain.c:4553
        __func__ = &quot;g_main_loop_run&quot;
#17 0x00007ff9cbb143b1 in WTF::RunLoop::run() ()
    at /buildstream/gnome/sdk/webkitgtk-6.0.bst/Source/WTF/wtf/glib/RunLoopGLib.cpp:108
        runLoop = @0x7ff9b20100e0: {&lt;WTF::SerialFunctionDispatcher&gt; = {&lt;WTF::FunctionDispatcher&gt; = {_vptr$FunctionDispatcher = 0x7ff9cbfa5d68 &lt;vtable for WTF::RunLoop+16&gt;}, &lt;No data fields&gt;}, &lt;WTF::ThreadSafeRefCounted&lt;WTF::RunLoop, (WTF::DestructionThread)0&gt;&gt; = {&lt;WTF::ThreadSafeRefCountedBase&gt; = {m_refCount = std::atomic&lt;unsigned int&gt; = { 417 }}, &lt;No data fields&gt;}, m_currentIteration = {m_start = 4, m_end = 5, m_buffer = {&lt;WTF::VectorBufferBase&lt;WTF::Function&lt;void ()&gt;, WTF::FastMalloc&gt;&gt; = {m_buffer = 0x7ff9b2a74e80, m_capacity = 16, m_size = 0}, &lt;No data fields&gt;}}, m_nextIterationLock = {static isHeldBit = 1 &apos;\001&apos;, static hasParkedBit = 2 &apos;\002&apos;, m_byte = {value = std::atomic&lt;unsigned char&gt; = { 0 &apos;\000&apos; }}}, m_nextIteration = {m_start = 0, m_end = 2, m_buffer = {&lt;WTF::VectorBufferBase&lt;WTF::Function&lt;void ()&gt;, WTF::FastMalloc&gt;&gt; = {m_buffer = 0x7ff7e6d70980, m_capacity = 16, m_size = 0}, &lt;No data fields&gt;}}, m_isFunctionDispatchSuspended = false, m_hasSuspendedFunctions = false, static s_runLoopSourceFunctions = {prepare = 0x0, check = 0x0, dispatch = 0x7ff9cbb13d90 &lt;WTF::RunLoop::$_0::__invoke(_GSource*, int (*)(void*), void*)&gt;, finalize = 0x0, closure_callback = 0x0, closure_marshal = 0x0}, m_mainContext = {m_ptr = 0x5642467c4ab0}, m_mainLoops = WTF::Vector of length 1, capacity 16 = {{m_ptr = 0x564246804e00}}, m_source = {m_ptr = 0x564246804eb0}, m_observers = {m_set = {m_impl = {static smallMaxLoadNumerator = 3, static smallMaxLoadDenominator = 4, static largeMaxLoadNumerator = 1, static largeMaxLoadDenominator = 2, static maxSmallTableCapacity = 1024, static minLoad = 6, static tableSizeOffset = -1, static tableSizeMaskOffset = -2, static keyCountOffset = -3, static deletedCountOffset = -4, static metadataSize = 16, {m_table = 0x0, m_tableForLLDB = 0x0}}}, m_operationCountSinceLastCleanup = 0}}
        mainContext = 0x5642467c4ab0
        innermostLoop = 0x564246804e00
        nestedMainLoop = &lt;optimized out&gt;
#18 0x00007ff9cd255857 in WebKit::AuxiliaryProcessMainBase&lt;WebKit::WebProcess, true&gt;::run(int, char**)
    (this=0x7ffe5b402b40, argc=3, argv=&lt;optimized out&gt;)
    at /buildstream/gnome/sdk/webkitgtk-6.0.bst/Source/WebKit/Shared/AuxiliaryProcessMain.h:72
        auxiliaryMain = {m_storage = {__data = &quot;p\276B\320\371\177&quot;, &apos;\000&apos; &lt;repeats 26 times&gt;, &quot;\017\005\000\000\000\000\000\000\001\000\000\000\000\000\000\000r&quot;, &apos;\000&apos; &lt;repeats 22 times&gt;, __align = {&lt;No data fields&gt;}}}
#19 WebKit::AuxiliaryProcessMain&lt;WebKit::WebProcessMainGtk&gt;(int, char**) (argc=3, argv=&lt;optimized out&gt;)
    at /buildstream/gnome/sdk/webkitgtk-6.0.bst/Source/WebKit/Shared/AuxiliaryProcessMain.h:98
        auxiliaryMain = {m_storage = {__data = &quot;p\276B\320\371\177&quot;, &apos;\000&apos; &lt;repeats 26 times&gt;, &quot;\017\005\000\000\000\000\000\000\001\000\000\000\000\000\000\000r&quot;, &apos;\000&apos; &lt;repeats 22 times&gt;, __align = {&lt;No data fields&gt;}}}
#20 0x00007ff9cc23bb8a in __libc_start_call_main
    (main=main@entry=0x56424607e150 &lt;main(int, char**)&gt;, argc=argc@entry=3, argv=argv@entry=0x7ffe5b402cd8)
    at ../sysdeps/nptl/libc_start_call_main.h:58
        self = &lt;optimized out&gt;
        result = &lt;optimized out&gt;
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140730429353176, -5724701081780959803, 3, 0, 140710921564160, 94842642763168, -5724701081766279739, -5727760185627982395}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x3, 0x7ffe5b402cd0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 3}}}
        not_first_call = &lt;optimized out&gt;
#21 0x00007ff9cc23bc4b in __libc_start_main_impl
    (main=0x56424607e150 &lt;main(int, char**)&gt;, argc=3, argv=0x7ffe5b402cd8, init=&lt;optimized out&gt;, fini=&lt;optimized out&gt;, rtld_fini=&lt;optimized out&gt;, stack_end=0x7ffe5b402cc8) at ../csu/libc-start.c:360
#22 0x000056424607e085 in _start () at ../sysdeps/x86_64/start.S:115</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1967067</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2023-07-17 11:08:38 -0700</bug_when>
    <thetext>This is with WebKitGTK 2.41.6</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1967176</commentid>
    <comment_count>2</comment_count>
    <who name="Philippe Normand">philn</who>
    <bug_when>2023-07-18 07:44:59 -0700</bug_when>
    <thetext>In frame 4 m_player is a WeakPtr so it should be checked, oops.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1967182</commentid>
    <comment_count>3</comment_count>
    <who name="Philippe Normand">pnormand</who>
    <bug_when>2023-07-18 08:05:40 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/15906</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1967200</commentid>
    <comment_count>4</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2023-07-18 10:02:52 -0700</bug_when>
    <thetext>Committed 266132@main (b6f626b07c72): &lt;https://commits.webkit.org/266132@main&gt;

Reviewed commits have been landed. Closing PR #15906 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1967201</commentid>
    <comment_count>5</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-07-18 10:03:25 -0700</bug_when>
    <thetext>&lt;rdar://problem/112477332&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>