Bug 221634

Summary: REGRESSION: (r272458): [BigSur Debug] ASSERTION FAILED: m_haveAddedMediaUsageManagerSession in WebCore::MediaElementSession::updateMediaUsageIfChanged()
Product: WebKit Reporter: Amir Mark Jr <amir_mark>
Component: MediaAssignee: Eric Carlson <eric.carlson>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, changseok, eric.carlson, esprehn+autocc, ews-watchlist, glenn, gyuyoung.kim, jer.noble, philipj, rniwa, sergio, tetsuharu.ohzeki, webkit-bot-watchers-bugzilla, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Amir Mark Jr 2021-02-09 14:55:43 PST
imported/w3c/web-platform-tests/shadow-dom/declarative/declarative-shadow-dom-attachment.tentative.html

Is consistently crashing on BigSur Debug Wk1 and Wk2.

History: 

https://results.webkit.org/?suite=layout-tests&test=imported%2Fw3c%2Fweb-platform-tests%2Fshadow-dom%2Fdeclarative%2Fdeclarative-shadow-dom-attachment.tentative.html

Crash Log:

ASSERTION FAILED: m_haveAddedMediaUsageManagerSession
./html/MediaElementSession.cpp(1172) : virtual void WebCore::MediaElementSession::updateMediaUsageIfChanged()
1   0x10c3fdc69 WTFCrash
2   0x12d2a0d0b WTFCrashWithInfo(int, char const*, char const*, int)
3   0x1309d3119 WebCore::MediaElementSession::updateMediaUsageIfChanged()
4   0x12ecde360 auto WebCore::MediaSessionManagerCocoa::scheduleSessionStatusUpdate()::$_8::operator()()::'lambda'(auto&)::operator()<WebCore::PlatformMediaSession>(auto&) const
5   0x12ecde313 WTF::Detail::CallableWrapper<WebCore::MediaSessionManagerCocoa::scheduleSessionStatusUpdate()::$_8::operator()()::'lambda'(auto&), void, WebCore::PlatformMediaSession&>::call(WebCore::PlatformMediaSession&)
6   0x13152697a WTF::Function<void (WebCore::PlatformMediaSession&)>::operator()(WebCore::PlatformMediaSession&) const
7   0x1315240aa WebCore::PlatformMediaSessionManager::forEachSession(WTF::Function<void (WebCore::PlatformMediaSession&)> const&)
8   0x12ecddfbb WebCore::MediaSessionManagerCocoa::scheduleSessionStatusUpdate()::$_8::operator()()
9   0x12ecddf0e WTF::Detail::CallableWrapper<WebCore::MediaSessionManagerCocoa::scheduleSessionStatusUpdate()::$_8, void>::call()
10  0x12d2b60a2 WTF::Function<void ()>::operator()() const
11  0x12d66c7b5 WebCore::GenericTaskQueue<WebCore::Timer>::enqueueTask(WTF::Function<void ()>&&)::'lambda'()::operator()() const
12  0x12d66c5ee WTF::Detail::CallableWrapper<WebCore::GenericTaskQueue<WebCore::Timer>::enqueueTask(WTF::Function<void ()>&&)::'lambda'(), void>::call()
13  0x12d2b60a2 WTF::Function<void ()>::operator()() const
14  0x131488d6f WebCore::TaskDispatcher<WebCore::Timer>::dispatchOneTask()
15  0x131488a45 WebCore::TaskDispatcher<WebCore::Timer>::sharedTimerFired()
16  0x1314903e1 WebCore::TaskDispatcher<WebCore::Timer>::sharedTimer()::$_2::operator()() const
17  0x13149039e WTF::Detail::CallableWrapper<WebCore::TaskDispatcher<WebCore::Timer>::sharedTimer()::$_2, void>::call()
18  0x12d2b60a2 WTF::Function<void ()>::operator()() const
19  0x12d2f907e WebCore::Timer::fired()
20  0x1314e67e4 WebCore::ThreadTimers::sharedTimerFiredInternal()
21  0x1314f3211 WebCore::ThreadTimers::setSharedTimer(WebCore::SharedTimer*)::$_0::operator()() const
22  0x1314f31be WTF::Detail::CallableWrapper<WebCore::ThreadTimers::setSharedTimer(WebCore::SharedTimer*)::$_0, void>::call()
23  0x12d2b60a2 WTF::Function<void ()>::operator()() const
24  0x1314a3eeb WebCore::MainThreadSharedTimer::fired()
25  0x131566886 WebCore::timerFired(__CFRunLoopTimer*, void*)
26  0x7fff2047390d __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__
27  0x7fff204733e8 __CFRunLoopDoTimer
28  0x7fff20472f42 __CFRunLoopDoTimers
29  0x7fff2045957f __CFRunLoopRun
30  0x7fff204586ce CFRunLoopRunSpecific
31  0x10b15ac7a runTest(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)



Able to reproduce issue using command:

run-webkit-tests imported/w3c/web-platform-tests/shadow-dom/declarative/declarative-shadow-dom-attachment.tentative.html --debug --iterations 1000 -f
Comment 1 Radar WebKit Bug Importer 2021-02-09 14:56:08 PST
<rdar://problem/74161017>
Comment 2 Eric Carlson 2021-02-09 16:54:10 PST
Created attachment 419785 [details]
Patch
Comment 3 Ryosuke Niwa 2021-02-09 17:16:06 PST
Comment on attachment 419785 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=419785&action=review

> Source/WebCore/html/MediaElementSession.cpp:-131
> -    addedMediaUsageManagerSessionIfNecessary();

LOL.
Comment 4 EWS 2021-02-09 19:31:02 PST
Committed r272633: <https://commits.webkit.org/r272633>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 419785 [details].