<?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>250480</bug_id>
          
          <creation_ts>2023-01-11 15:06:36 -0800</creation_ts>
          <short_desc>REGRESSION(258663@main) [GStreamer] MIME API test crashes due to GStreamer being initialized in UIProcess</short_desc>
          <delta_ts>2023-01-12 13:28:19 -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=220542</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="Lauro Moura">lmoura</reporter>
          <assigned_to name="Philippe Normand">philn</assigned_to>
          <cc>bugs-noreply</cc>
    
    <cc>calvaris</cc>
    
    <cc>philn</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1924905</commentid>
    <comment_count>0</comment_count>
    <who name="Lauro Moura">lmoura</who>
    <bug_when>2023-01-11 15:06:36 -0800</bug_when>
    <thetext>Tests

/WebKitGTK/TestWebKitWebView
    /webkit/WebKitWebView/can-show-mime-type
/TestWebCore
    MIMETypeRegistry.CanShowMIMEType

To reproduce:

./Tools/Scripts/run-gtk-tests --debug --display-server=xvfb WebKitBuild/GTK/Debug/bin/TestWebKitAPI/TestWebCore -p MIMETypeRegistry.CanShowMIMEType

or

./Tools/Scripts/run-gtk-tests --release --display-server=xvfb WebKitBuild/GTK/Release/bin/TestWebKitAPI/WebKitGTK/TestWebKitWebView -p /webkit/WebKitWebView/can-show-mime-type

258663@main added a `registerWebKitGStreamer()` call inside `GStreamerRegistryScanner()`, which in turn is called by `MIMETypeRegistry::canShowMIMEType()`.

Trace for the WebCore test:

gdb) bt
#0  WTFCrash() () at /app/webkit/Source/WTF/wtf/Assertions.cpp:327
#1  0x000055555b475152 in WTFCrashWithInfo(int, char const*, char const*, int) () at /app/webkit/WebKitBuild/Debug/WTF/Headers/wtf/Assertions.h:754
#2  0x000055555b81f789 in WebCore::ensureGStreamerInitialized() () at /app/webkit/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp:270
#3  0x000055555b972d4d in operator()() const (__closure=0x7fffffffccd7) at /app/webkit/Source/WebCore/platform/graphics/gstreamer/eme/CDMThunder.cpp:98
#4  0x000055555b97896c in std::__invoke_impl&lt;void, WebCore::CDMFactoryThunder::singleton()::&lt;lambda()&gt; &gt;(std::__invoke_other, struct {...} &amp;&amp;) (__f=...) at /usr/include/c++/12.1.0/bits/invoke.h:61
#5  0x000055555b977f15 in std::__invoke&lt;WebCore::CDMFactoryThunder::singleton()::&lt;lambda()&gt; &gt;(struct {...} &amp;&amp;) (__fn=...) at /usr/include/c++/12.1.0/bits/invoke.h:96
#6  0x000055555b97798b in operator()() const (__closure=0x7fffffffccb0) at /usr/include/c++/12.1.0/mutex:852
#7  0x000055555b977f3f in operator()() const (__closure=0x0) at /usr/include/c++/12.1.0/mutex:788
#8  0x000055555b977f50 in _FUN() () at /usr/include/c++/12.1.0/mutex:788
#9  0x00007fffee4f8423 in __pthread_once_slow (once_control=0x555561111698 &lt;WebCore::CDMFactoryThunder::singleton()::onceFlag&gt;, init_routine=0x7fffee859cb0 &lt;std::__once_proxy()&gt;) at pthread_once.c:116
#10 0x000055555b972b1c in __gthread_once(__gthread_once_t*, void (*)()) (__once=0x555561111698 &lt;WebCore::CDMFactoryThunder::singleton()::onceFlag&gt;, __func=0x7fffee859cb0 &lt;std::__once_proxy()&gt;) at /usr/include/c++/12.1.0/x86_64-unknown-linux-gnu/bits/gthr-default.h:700
#11 0x000055555b9779de in std::call_once&lt;WebCore::CDMFactoryThunder::singleton()::&lt;lambda()&gt; &gt;(std::once_flag &amp;, struct {...} &amp;&amp;) (__once=..., __f=...) at /usr/include/c++/12.1.0/mutex:859
#12 0x000055555b972daf in WebCore::CDMFactoryThunder::singleton() () at /app/webkit/Source/WebCore/platform/graphics/gstreamer/eme/CDMThunder.cpp:97
#13 0x000055555b81f836 in operator()() const (__closure=0x7fffffffcec7) at /app/webkit/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp:341
#14 0x000055555b822e99 in std::__invoke_impl&lt;void, WebCore::registerWebKitGStreamerElements()::&lt;lambda()&gt; &gt;(std::__invoke_other, struct {...} &amp;&amp;) (__f=...) at /usr/include/c++/12.1.0/bits/invoke.h:61
#15 0x000055555b82299b in std::__invoke&lt;WebCore::registerWebKitGStreamerElements()::&lt;lambda()&gt; &gt;(struct {...} &amp;&amp;) (__fn=...) at /usr/include/c++/12.1.0/bits/invoke.h:96
#16 0x000055555b822437 in operator()() const (__closure=0x7fffffffcea0) at /usr/include/c++/12.1.0/mutex:852
#17 0x000055555b8229c5 in operator()() const (__closure=0x0) at /usr/include/c++/12.1.0/mutex:788
#18 0x000055555b8229d6 in _FUN() () at /usr/include/c++/12.1.0/mutex:788
#19 0x00007fffee4f8423 in __pthread_once_slow (once_control=0x555561110e90 &lt;WebCore::registerWebKitGStreamerElements()::onceFlag&gt;, init_routine=0x7fffee859cb0 &lt;std::__once_proxy()&gt;) at pthread_once.c:116
#20 0x000055555b81e784 in __gthread_once(__gthread_once_t*, void (*)()) (__once=0x555561110e90 &lt;WebCore::registerWebKitGStreamerElements()::onceFlag&gt;, __func=0x7fffee859cb0 &lt;std::__once_proxy()&gt;) at /usr/include/c++/12.1.0/x86_64-unknown-linux-gnu/bits/gthr-default.h:700
#21 0x000055555b82248a in std::call_once&lt;WebCore::registerWebKitGStreamerElements()::&lt;lambda()&gt; &gt;(std::once_flag &amp;, struct {...} &amp;&amp;) (__once=..., __f=...) at /usr/include/c++/12.1.0/mutex:859
#22 0x000055555b81fc5f in WebCore::registerWebKitGStreamerElements() () at /app/webkit/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp:338
#23 0x000055555b82833e in WebCore::GStreamerRegistryScanner::GStreamerRegistryScanner(bool) (this=0x7fffffffd040, isMediaSource=false) at /app/webkit/Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.cpp:236
#24 0x000055555b8275d5 in WebCore::GStreamerRegistryScanner::getSupportedDecodingTypes(WTF::HashSet&lt;WTF::String, WTF::ASCIICaseInsensitiveHash, WTF::HashTraits&lt;WTF::String&gt;, WTF::HashTableTraits&gt;&amp;) (types=...)
    at /app/webkit/Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.cpp:64
#25 0x000055555b85e9e6 in WebCore::MediaPlayerPrivateGStreamer::getSupportedTypes(WTF::HashSet&lt;WTF::String, WTF::ASCIICaseInsensitiveHash, WTF::HashTraits&lt;WTF::String&gt;, WTF::HashTableTraits&gt;&amp;) (types=...)
    at /app/webkit/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:2587
#26 0x000055555b876164 in WebCore::MediaPlayerFactoryGStreamer::getSupportedTypes(WTF::HashSet&lt;WTF::String, WTF::ASCIICaseInsensitiveHash, WTF::HashTraits&lt;WTF::String&gt;, WTF::HashTableTraits&gt;&amp;) const (this=0x7fffe300a160, types=...)
    at /app/webkit/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:290
#27 0x000055555f73cf9f in WebCore::MediaPlayer::getSupportedTypes(WTF::HashSet&lt;WTF::String, WTF::ASCIICaseInsensitiveHash, WTF::HashTraits&lt;WTF::String&gt;, WTF::HashTableTraits&gt;&amp;) (types=...) at /app/webkit/Source/WebCore/platform/graphics/MediaPlayer.cpp:1171
#28 0x000055555f4d3f72 in operator()() const (__closure=0x7fffffffd23f) at /app/webkit/Source/WebCore/platform/MIMETypeRegistry.cpp:237
#29 0x000055555f4d3fcc in WebCore::MIMETypeRegistry::supportedMediaMIMETypes() () at /app/webkit/Source/WebCore/platform/MIMETypeRegistry.cpp:240
#30 0x000055555f4d51d0 in WebCore::MIMETypeRegistry::isSupportedMediaMIMEType(WTF::String const&amp;) (mimeType=...) at /app/webkit/Source/WebCore/platform/MIMETypeRegistry.cpp:577
#31 0x000055555f4d582c in WebCore::MIMETypeRegistry::canShowMIMEType(WTF::String const&amp;) (mimeType=...) at /app/webkit/Source/WebCore/platform/MIMETypeRegistry.cpp:666
#32 0x000055555b567769 in TestWebKitAPI::MIMETypeRegistry_CanShowMIMEType_Test::TestBody() (this=0x5555611f6630) at /app/webkit/Tools/TestWebKitAPI/Tests/WebCore/MIMETypeRegistry.cpp:65
#33 0x00007ffff7f8b481 in testing::internal::HandleSehExceptionsInMethodIfSupported&lt;testing::Test, void&gt;(testing::Test*, void (testing::Test::*)(), char const*) (object=0x5555611f6630, method=&amp;virtual testing::Test::TestBody(), location=0x7ffff7f3b79c &quot;the test body&quot;)
    at /app/webkit/Source/ThirdParty/gtest/src/gtest.cc:2607
#34 0x00007ffff7f844a7 in testing::internal::HandleExceptionsInMethodIfSupported&lt;testing::Test, void&gt;(testing::Test*, void (testing::Test::*)(), char const*) (object=0x5555611f6630, method=&amp;virtual testing::Test::TestBody(), location=0x7ffff7f3b79c &quot;the test body&quot;)
    at /app/webkit/Source/ThirdParty/gtest/src/gtest.cc:2662
#35 0x00007ffff7f68d9a in testing::Test::Run() (this=0x5555611f6630) at /app/webkit/Source/ThirdParty/gtest/src/gtest.cc:2682
#36 0x00007ffff7f69612 in testing::TestInfo::Run() (this=0x55556117dc30) at /app/webkit/Source/ThirdParty/gtest/src/gtest.cc:2861
#37 0x00007ffff7f69e18 in testing::TestSuite::Run() (this=0x55556117d8f0) at /app/webkit/Source/ThirdParty/gtest/src/gtest.cc:3015
#38 0x00007ffff7f7671b in testing::internal::UnitTestImpl::RunAllTests() (this=0x555561163f20) at /app/webkit/Source/ThirdParty/gtest/src/gtest.cc:5851
#39 0x00007ffff7f8ca5c in testing::internal::HandleSehExceptionsInMethodIfSupported&lt;testing::internal::UnitTestImpl, bool&gt;(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*)
    (object=0x555561163f20, method=(bool (testing::internal::UnitTestImpl::*)(testing::internal::UnitTestImpl * const)) 0x7ffff7f7632e &lt;testing::internal::UnitTestImpl::RunAllTests()&gt;, location=0x7ffff7f3c238 &quot;auxiliary test code (environments or event listeners)&quot;)
    at /app/webkit/Source/ThirdParty/gtest/src/gtest.cc:2607
#40 0x00007ffff7f85421 in testing::internal::HandleExceptionsInMethodIfSupported&lt;testing::internal::UnitTestImpl, bool&gt;(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*)
    (object=0x555561163f20, method=(bool (testing::internal::UnitTestImpl::*)(testing::internal::UnitTestImpl * const)) 0x7ffff7f7632e &lt;testing::internal::UnitTestImpl::RunAllTests()&gt;, location=0x7ffff7f3c238 &quot;auxiliary test code (environments or event listeners)&quot;)
    at /app/webkit/Source/ThirdParty/gtest/src/gtest.cc:2662
#41 0x00007ffff7f752bb in testing::UnitTest::Run() (this=0x7ffff7fbd340 &lt;testing::UnitTest::GetInstance()::instance&gt;) at /app/webkit/Source/ThirdParty/gtest/src/gtest.cc:5434
#42 0x000055555b4730ab in RUN_ALL_TESTS() () at /app/webkit/Source/ThirdParty/gtest/include/gtest/gtest.h:2471
#43 0x000055555b472c39 in TestWebKitAPI::TestsController::run(int, char**) (this=0x555561110009 &lt;TestWebKitAPI::TestsController::singleton()::shared&gt;, argc=3, argv=0x7fffffffd828) at /app/webkit/Tools/TestWebKitAPI/TestsController.cpp:89
#44 0x000055555b5ce32a in main(int, char**) (argc=3, argv=0x7fffffffd828) at /app/webkit/Tools/TestWebKitAPI/gtk/main.cpp:39</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1924932</commentid>
    <comment_count>1</comment_count>
    <who name="Lauro Moura">lmoura</who>
    <bug_when>2023-01-11 16:24:27 -0800</bug_when>
    <thetext>Gardened in https://commits.webkit.org/258811@main</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1925009</commentid>
    <comment_count>2</comment_count>
    <who name="Philippe Normand">philn</who>
    <bug_when>2023-01-12 00:46:18 -0800</bug_when>
    <thetext>&gt; 258663@main added a `registerWebKitGStreamer()` call inside `GStreamerRegistryScanner()`, which in turn is called by `MIMETypeRegistry::canShowMIMEType()`.

Oops. Thanks for gardening this, I&apos;ll prepare a fix.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1925014</commentid>
    <comment_count>3</comment_count>
    <who name="Philippe Normand">pnormand</who>
    <bug_when>2023-01-12 02:54:58 -0800</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/8566</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1925126</commentid>
    <comment_count>4</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2023-01-12 13:27:52 -0800</bug_when>
    <thetext>Committed 258848@main (8c38ebd63c97): &lt;https://commits.webkit.org/258848@main&gt;

Reviewed commits have been landed. Closing PR #8566 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1925127</commentid>
    <comment_count>5</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-01-12 13:28:19 -0800</bug_when>
    <thetext>&lt;rdar://problem/104192318&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>