Bug 225332

Summary: REGRESSION (r276883): [Debug] ASSERTION FAILED: index != notFound in WebCore::PlatformMediaSessionManager::setCurrentSession()
Product: WebKit Reporter: Truitt Savell <tsavell>
Component: MediaAssignee: Jer Noble <jer.noble>
Status: RESOLVED FIXED    
Severity: Normal CC: calvaris, cdumez, changseok, eric.carlson, esprehn+autocc, ews-watchlist, glenn, gyuyoung.kim, jer.noble, philipj, sergio, webkit-bot-watchers-bugzilla, 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=225273
Attachments:
Description Flags
crash log
none
Patch none

Description Truitt Savell 2021-05-03 15:49:25 PDT
imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audiocontext-interface/suspend-after-construct.html

This test began crashing with the changes in https://trac.webkit.org/changeset/276883/webkit

History:
imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audiocontext-interface/suspend-after-construct.html

Log;
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   com.apple.JavaScriptCore      	0x000000065a2a73be WTFCrash + 14 (Assertions.cpp:305)
1   com.apple.WebCore             	0x0000000639610eeb WTFCrashWithInfo(int, char const*, char const*, int) + 27 (Assertions.h:695)
2   com.apple.WebCore             	0x000000063dab1dd5 WebCore::PlatformMediaSessionManager::setCurrentSession(WebCore::PlatformMediaSession&) + 293 (PlatformMediaSessionManager.cpp:312)
3   com.apple.WebCore             	0x000000063b1764b7 WebCore::MediaSessionManagerCocoa::setCurrentSession(WebCore::PlatformMediaSession&) + 39 (MediaSessionManagerCocoa.mm:213)

https://build.webkit.org/results/Apple-BigSur-Debug-WK2-Tests/r276920%20(1605)/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audiocontext-interface/suspend-after-construct-crash-log.txt
Comment 1 Radar WebKit Bug Importer 2021-05-03 15:49:43 PDT
<rdar://problem/77476145>
Comment 2 Ryan Haddad 2021-05-03 16:44:53 PDT
Created attachment 427616 [details]
crash log

ASSERTION FAILED: index != notFound
./platform/audio/PlatformMediaSessionManager.cpp(312) : virtual void WebCore::PlatformMediaSessionManager::setCurrentSession(WebCore::PlatformMediaSession &)
Comment 3 Jer Noble 2021-05-03 17:50:57 PDT
Yep, caused by r276883. I'm super curious how this wasn't hit by the EWS bots though.
Comment 4 Jer Noble 2021-05-03 17:51:37 PDT
The session is setActive(true) immediately after the ASSERT. Looks like we need to move up the activation by a couple lines.
Comment 5 Jer Noble 2021-05-04 08:59:09 PDT
Created attachment 427672 [details]
Patch
Comment 6 EWS 2021-05-04 12:29:40 PDT
Committed r276978 (237305@main): <https://commits.webkit.org/237305@main>

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