Bug 207741 - [EME][GStreamer] REGRESSION(r256429): Several encrypted-media tests are crashing or failing
Summary: [EME][GStreamer] REGRESSION(r256429): Several encrypted-media tests are crash...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Charlie Turner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-13 20:54 PST by Diego Pino
Modified: 2020-02-14 10:23 PST (History)
3 users (show)

See Also:


Attachments
Patch (6.85 KB, patch)
2020-02-14 06:52 PST, Charlie Turner
no flags Details | Formatted Diff | Diff
Patch for landing (7.90 KB, patch)
2020-02-14 09:25 PST, Charlie Turner
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Diego Pino 2020-02-13 20:54:00 PST
* imported/w3c/web-platform-tests/encrypted-media/clearkey-events.https.html [ Crash ]
  * imported/w3c/web-platform-tests/encrypted-media/clearkey-keystatuses-multiple-sessions.https.html [ Crash ]
  * imported/w3c/web-platform-tests/encrypted-media/clearkey-keystatuses.https.html [ Crash ]
  * imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-events.https.html [ Crash ]
  * imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-multikey-sequential-readyState.https.html [ Crash ]
  * imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-multikey-sequential.https.html [ Crash ]
  * imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-multisession.https.html [ Crash ]
  * imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-setMediaKeys-after-src.https.html [ Crash ]
  * imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-setMediaKeys-after-update.https.html [ Crash ]
  * imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-update-disallowed-input.https.html [ Crash ]
  * imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-destroy-persistent-license.https.html [ Failure ]
  * imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-retrieve-destroy-persistent-license.https.html [ Failure ]
  * imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-retrieve-persistent-license.https.html [ Failure ]

imported/w3c/web-platform-tests/encrypted-media/clearkey-events.https.html
Stacktrace:

STDERR: ASSERTION FAILED: m_cdmProxy
STDERR: ../../Source/WebCore/platform/encryptedmedia/CDMProxy.cpp(291) : void WebCore::CDMInstanceProxy::mergeKeysFrom(const WebCore::KeyStore&)
STDERR: 1   0x7fdf29ae13b5 WTFCrash
STDERR: 2   0x7fdf248a1ccd WTF::CrashOnOverflow::overflowed()
STDERR: 3   0x7fdf276524d2 WebCore::CDMInstanceProxy::mergeKeysFrom(WebCore::KeyStore const&)
STDERR: 4   0x7fdf28576c7c WebCore::CDMInstanceSessionClearKey::updateLicense(WTF::String const&, WebCore::CDMSessionType, WebCore::SharedBuffer const&, WTF::CompletionHandler<void (bool, WTF::Optional<WTF::Vector<std::pair<WTF::Ref<WebCore::SharedBuffer, WTF::DumbPtrTraits<WebCore::SharedBuffer> >, WebCore::CDMKeyStatus>, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc> >&&, WTF::Optional<double>&&, WTF::Optional<std::pair<WebCore::CDMMessageType, WTF::Ref<WebCore::SharedBuffer, WTF::DumbPtrTraits<WebCore::SharedBuffer> > > >&&, WebCore::CDMInstanceSession::SuccessValue)>&&)
STDERR: 5   0x7fdf2815f0dd
STDERR: 6   0x7fdf2816790c
STDERR: 7   0x7fdf248d836b WTF::Function<void ()>::operator()() const
STDERR: 8   0x7fdf281687a2 WebCore::ActiveDOMObject::queueTaskKeepingObjectAlive<WebCore::MediaKeySession>(WebCore::MediaKeySession&, WebCore::TaskSource, WTF::Function<void ()>&&)::{lambda()#1}::operator()() const
STDERR: 9   0x7fdf2816c922 WTF::Detail::CallableWrapper<WebCore::ActiveDOMObject::queueTaskKeepingObjectAlive<WebCore::MediaKeySession>(WebCore::MediaKeySession&, WebCore::TaskSource, WTF::Function<void ()>&&)::{lambda()#1}, void>::call()
STDERR: 10  0x7fdf248d836b WTF::Function<void ()>::operator()() const
STDERR: 11  0x7fdf26bc232a WebCore::EventLoopFunctionDispatchTask::execute()
STDERR: 12  0x7fdf26bc0e24 WebCore::EventLoop::run()
STDERR: 13  0x7fdf26ce4743 WebCore::WindowEventLoop::didReachTimeToRun()
STDERR: 14  0x7fdf26cf323c void std::__invoke_impl<void, void (WebCore::WindowEventLoop::*&)(), WebCore::WindowEventLoop*&>(std::__invoke_memfun_deref, void (WebCore::WindowEventLoop::*&)(), WebCore::WindowEventLoop*&)
STDERR: 15  0x7fdf26cf31b3 std::__invoke_result<void (WebCore::WindowEventLoop::*&)(), WebCore::WindowEventLoop*&>::type std::__invoke<void (WebCore::WindowEventLoop::*&)(), WebCore::WindowEventLoop*&>(void (WebCore::WindowEventLoop::*&)(), WebCore::WindowEventLoop*&)
STDERR: 16  0x7fdf26cf312e void std::_Bind<void (WebCore::WindowEventLoop::*(WebCore::WindowEventLoop*))()>::__call<void, , 0ul>(std::tuple<>&&, std::_Index_tuple<0ul>)
STDERR: 17  0x7fdf26cf30e4 void std::_Bind<void (WebCore::WindowEventLoop::*(WebCore::WindowEventLoop*))()>::operator()<, void>()
STDERR: 18  0x7fdf26cf30be WTF::Detail::CallableWrapper<std::_Bind<void (WebCore::WindowEventLoop::*(WebCore::WindowEventLoop*))()>, void>::call()
STDERR: 19  0x7fdf248d836b WTF::Function<void ()>::operator()() const
STDERR: 20  0x7fdf24cecc34 WebCore::Timer::fired()
STDERR: 21  0x7fdf27607b93 WebCore::ThreadTimers::sharedTimerFiredInternal()
STDERR: 22  0x7fdf276075a7
STDERR: 23  0x7fdf2760c090
STDERR: 24  0x7fdf248d836b WTF::Function<void ()>::operator()() const
STDERR: 25  0x7fdf275dddc0 WebCore::MainThreadSharedTimer::fired()
STDERR: 26  0x7fdf275e48e2 WTF::RunLoop::Timer<WebCore::MainThreadSharedTimer>::fired()
STDERR: 27  0x7fdf29b94691
STDERR: 28  0x7fdf29b946e9
STDERR: 29  0x7fdf29b93dbc
STDERR: 30  0x7fdf29b93dec
STDERR: 31  0x7fdf13c006b8 g_main_context_dispatch
STDERR: LEAK: 1 WebPageProxy

More stacktraces: https://build.webkit.org/results/WPE%20Linux%2064-bit%20Debug%20(Tests)/r256504%20(3471)/results.html
Comment 1 Charlie Turner 2020-02-14 04:11:56 PST
The reason these assertions were not caught during development is that I work with the GTK port on the desktop, and these imported W3C tests are not enabled there, which they should have been. There's no need for different expectations between this ports for this feature at least. Separate issue now.

The reason for the failures is that the W3C tests do not use the setMediaKeys() API to associate the key session with the player. The spec does say applications are supposed to handle implementations that can not continue key session algorithms without this association, but nowadays goes on to concede that such implementations are "uncommon"...

Most real-world players and indeed other tests simply ensure they call setMediaKeys() after the key session is created for this reason. In our architecture, this is important since cdmInstanceAttached() is used internally as a sync point for other setup steps that are prerequisites for key session algorithms. I'll think more about a workaround, a very simple solution is to fix the W3C tests, but they also consider us uncommon, so it'd be nice to be a common implementation instead.
Comment 2 Charlie Turner 2020-02-14 06:49:38 PST
I decided the best choice is to skip these tests for WPE as well as GTK to give me time to correctly triage them. There are new passes, crashes and timeouts in equal measure, so this is not removing any useful testing.
Comment 3 Charlie Turner 2020-02-14 06:52:35 PST
Created attachment 390759 [details]
Patch
Comment 4 Charlie Turner 2020-02-14 09:25:18 PST
Created attachment 390777 [details]
Patch for landing
Comment 5 WebKit Commit Bot 2020-02-14 10:23:47 PST
Comment on attachment 390777 [details]
Patch for landing

Clearing flags on attachment: 390777

Committed r256622: <https://trac.webkit.org/changeset/256622>
Comment 6 WebKit Commit Bot 2020-02-14 10:23:48 PST
All reviewed patches have been landed.  Closing bug.