Bug 250480

Summary: REGRESSION(258663@main) [GStreamer] MIME API test crashes due to GStreamer being initialized in UIProcess
Product: WebKit Reporter: Lauro Moura <lmoura>
Component: MediaAssignee: Philippe Normand <philn>
Status: RESOLVED FIXED    
Severity: Normal CC: bugs-noreply, calvaris, philn, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=220542

Lauro Moura
Reported 2023-01-11 15:06:36 PST
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<void, WebCore::CDMFactoryThunder::singleton()::<lambda()> >(std::__invoke_other, struct {...} &&) (__f=...) at /usr/include/c++/12.1.0/bits/invoke.h:61 #5 0x000055555b977f15 in std::__invoke<WebCore::CDMFactoryThunder::singleton()::<lambda()> >(struct {...} &&) (__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 <WebCore::CDMFactoryThunder::singleton()::onceFlag>, init_routine=0x7fffee859cb0 <std::__once_proxy()>) at pthread_once.c:116 #10 0x000055555b972b1c in __gthread_once(__gthread_once_t*, void (*)()) (__once=0x555561111698 <WebCore::CDMFactoryThunder::singleton()::onceFlag>, __func=0x7fffee859cb0 <std::__once_proxy()>) at /usr/include/c++/12.1.0/x86_64-unknown-linux-gnu/bits/gthr-default.h:700 #11 0x000055555b9779de in std::call_once<WebCore::CDMFactoryThunder::singleton()::<lambda()> >(std::once_flag &, struct {...} &&) (__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<void, WebCore::registerWebKitGStreamerElements()::<lambda()> >(std::__invoke_other, struct {...} &&) (__f=...) at /usr/include/c++/12.1.0/bits/invoke.h:61 #15 0x000055555b82299b in std::__invoke<WebCore::registerWebKitGStreamerElements()::<lambda()> >(struct {...} &&) (__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 <WebCore::registerWebKitGStreamerElements()::onceFlag>, init_routine=0x7fffee859cb0 <std::__once_proxy()>) at pthread_once.c:116 #20 0x000055555b81e784 in __gthread_once(__gthread_once_t*, void (*)()) (__once=0x555561110e90 <WebCore::registerWebKitGStreamerElements()::onceFlag>, __func=0x7fffee859cb0 <std::__once_proxy()>) at /usr/include/c++/12.1.0/x86_64-unknown-linux-gnu/bits/gthr-default.h:700 #21 0x000055555b82248a in std::call_once<WebCore::registerWebKitGStreamerElements()::<lambda()> >(std::once_flag &, struct {...} &&) (__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<WTF::String, WTF::ASCIICaseInsensitiveHash, WTF::HashTraits<WTF::String>, WTF::HashTableTraits>&) (types=...) at /app/webkit/Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.cpp:64 #25 0x000055555b85e9e6 in WebCore::MediaPlayerPrivateGStreamer::getSupportedTypes(WTF::HashSet<WTF::String, WTF::ASCIICaseInsensitiveHash, WTF::HashTraits<WTF::String>, WTF::HashTableTraits>&) (types=...) at /app/webkit/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:2587 #26 0x000055555b876164 in WebCore::MediaPlayerFactoryGStreamer::getSupportedTypes(WTF::HashSet<WTF::String, WTF::ASCIICaseInsensitiveHash, WTF::HashTraits<WTF::String>, WTF::HashTableTraits>&) const (this=0x7fffe300a160, types=...) at /app/webkit/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:290 #27 0x000055555f73cf9f in WebCore::MediaPlayer::getSupportedTypes(WTF::HashSet<WTF::String, WTF::ASCIICaseInsensitiveHash, WTF::HashTraits<WTF::String>, WTF::HashTableTraits>&) (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&) (mimeType=...) at /app/webkit/Source/WebCore/platform/MIMETypeRegistry.cpp:577 #31 0x000055555f4d582c in WebCore::MIMETypeRegistry::canShowMIMEType(WTF::String const&) (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<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) (object=0x5555611f6630, method=&virtual testing::Test::TestBody(), location=0x7ffff7f3b79c "the test body") at /app/webkit/Source/ThirdParty/gtest/src/gtest.cc:2607 #34 0x00007ffff7f844a7 in testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) (object=0x5555611f6630, method=&virtual testing::Test::TestBody(), location=0x7ffff7f3b79c "the test body") 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<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) (object=0x555561163f20, method=(bool (testing::internal::UnitTestImpl::*)(testing::internal::UnitTestImpl * const)) 0x7ffff7f7632e <testing::internal::UnitTestImpl::RunAllTests()>, location=0x7ffff7f3c238 "auxiliary test code (environments or event listeners)") at /app/webkit/Source/ThirdParty/gtest/src/gtest.cc:2607 #40 0x00007ffff7f85421 in testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) (object=0x555561163f20, method=(bool (testing::internal::UnitTestImpl::*)(testing::internal::UnitTestImpl * const)) 0x7ffff7f7632e <testing::internal::UnitTestImpl::RunAllTests()>, location=0x7ffff7f3c238 "auxiliary test code (environments or event listeners)") at /app/webkit/Source/ThirdParty/gtest/src/gtest.cc:2662 #41 0x00007ffff7f752bb in testing::UnitTest::Run() (this=0x7ffff7fbd340 <testing::UnitTest::GetInstance()::instance>) 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 <TestWebKitAPI::TestsController::singleton()::shared>, 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
Attachments
Lauro Moura
Comment 1 2023-01-11 16:24:27 PST
Philippe Normand
Comment 2 2023-01-12 00:46:18 PST
> 258663@main added a `registerWebKitGStreamer()` call inside `GStreamerRegistryScanner()`, which in turn is called by `MIMETypeRegistry::canShowMIMEType()`. Oops. Thanks for gardening this, I'll prepare a fix.
Philippe Normand
Comment 3 2023-01-12 02:54:58 PST
EWS
Comment 4 2023-01-12 13:27:52 PST
Committed 258848@main (8c38ebd63c97): <https://commits.webkit.org/258848@main> Reviewed commits have been landed. Closing PR #8566 and removing active labels.
Radar WebKit Bug Importer
Comment 5 2023-01-12 13:28:19 PST
Note You need to log in before you can comment on or make changes to this bug.