TestWebKitAPI.GPUProcess.CrashWhilePlayingAudioViaCreateMediaElementSource is flaky crashing. Reproduced crash locally on r279579, r279582, r279300. History: https://results.webkit.org/?suite=api-tests&test=TestWebKitAPI.GPUProcess.CrashWhilePlayingAudioViaCreateMediaElementSource&platform=mac Crashing with message: ASSERTION FAILED: !isInRoutingArbitrationForToken(token).
<rdar://problem/80237464>
TestWebKitAPI.GPUProcess.CrashWhilePlayingAudioViaCreateMediaElementSource ASSERTION FAILED: !isInRoutingArbitrationForToken(token) ./platform/audio/mac/SharedRoutingArbitrator.mm(55) : void WebCore::SharedRoutingArbitrator::beginRoutingArbitrationForToken(const WebCore::SharedRoutingArbitrator::Token &, AudioSession::CategoryType, WebCore::SharedRoutingArbitrator::ArbitrationCallback &&) 1 0x1057bc219 WTFCrash 2 0x121a2bebb WTFCrashWithInfo(int, char const*, char const*, int) 3 0x1236115f8 WebCore::SharedRoutingArbitrator::beginRoutingArbitrationForToken(WebCore::SharedRoutingArbitrator::Token const&, WebCore::AudioSession::CategoryType, WTF::CompletionHandler<void (WebCore::AudioSessionRoutingArbitrationClient::RoutingArbitrationError, WebCore::AudioSessionRoutingArbitrationClient::DefaultRouteChanged)>&&) 4 0x1116d7c19 WebKit::AudioSessionRoutingArbitratorProxy::beginRoutingArbitrationWithCategory(WebCore::AudioSession::CategoryType, WTF::CompletionHandler<void (WebCore::AudioSessionRoutingArbitrationClient::RoutingArbitrationError, WebCore::AudioSessionRoutingArbitrationClient::DefaultRouteChanged)>&&) 5 0x1101497f8 void IPC::callMemberFunctionImpl<WebKit::AudioSessionRoutingArbitratorProxy, void (WebKit::AudioSessionRoutingArbitratorProxy::*)(WebCore::AudioSession::CategoryType, WTF::CompletionHandler<void (WebCore::AudioSessionRoutingArbitrationClient::RoutingArbitrationError, WebCore::AudioSessionRoutingArbitrationClient::DefaultRouteChanged)>&&), void (WebCore::AudioSessionRoutingArbitrationClient::RoutingArbitrationError, WebCore::AudioSessionRoutingArbitrationClient::DefaultRouteChanged), std::__1::tuple<WebCore::AudioSession::CategoryType>, 0ul>(WebKit::AudioSessionRoutingArbitratorProxy*, void (WebKit::AudioSessionRoutingArbitratorProxy::*)(WebCore::AudioSession::CategoryType, WTF::CompletionHandler<void (WebCore::AudioSessionRoutingArbitrationClient::RoutingArbitrationError, WebCore::AudioSessionRoutingArbitrationClient::DefaultRouteChanged)>&&), WTF::CompletionHandler<void (WebCore::AudioSessionRoutingArbitrationClient::RoutingArbitrationError, WebCore::AudioSessionRoutingArbitrationClient::DefaultRouteChanged)>&&, std::__1::tuple<WebCore::AudioSession::CategoryType>&&, std::__1::integer_sequence<unsigned long, 0ul>) 6 0x1101471a5 void IPC::callMemberFunction<WebKit::AudioSessionRoutingArbitratorProxy, void (WebKit::AudioSessionRoutingArbitratorProxy::*)(WebCore::AudioSession::CategoryType, WTF::CompletionHandler<void (WebCore::AudioSessionRoutingArbitrationClient::RoutingArbitrationError, WebCore::AudioSessionRoutingArbitrationClient::DefaultRouteChanged)>&&), void (WebCore::AudioSessionRoutingArbitrationClient::RoutingArbitrationError, WebCore::AudioSessionRoutingArbitrationClient::DefaultRouteChanged), std::__1::tuple<WebCore::AudioSession::CategoryType>, std::__1::integer_sequence<unsigned long, 0ul> >(std::__1::tuple<WebCore::AudioSession::CategoryType>&&, WTF::CompletionHandler<void (WebCore::AudioSessionRoutingArbitrationClient::RoutingArbitrationError, WebCore::AudioSessionRoutingArbitrationClient::DefaultRouteChanged)>&&, WebKit::AudioSessionRoutingArbitratorProxy*, void (WebKit::AudioSessionRoutingArbitratorProxy::*)(WebCore::AudioSession::CategoryType, WTF::CompletionHandler<void (WebCore::AudioSessionRoutingArbitrationClient::RoutingArbitrationError, WebCore::AudioSessionRoutingArbitrationClient::DefaultRouteChanged)>&&)) 7 0x11014527e void IPC::handleMessageAsync<Messages::AudioSessionRoutingArbitratorProxy::BeginRoutingArbitrationWithCategory, WebKit::AudioSessionRoutingArbitratorProxy, void (WebKit::AudioSessionRoutingArbitratorProxy::*)(WebCore::AudioSession::CategoryType, WTF::CompletionHandler<void (WebCore::AudioSessionRoutingArbitrationClient::RoutingArbitrationError, WebCore::AudioSessionRoutingArbitrationClient::DefaultRouteChanged)>&&)>(IPC::Connection&, IPC::Decoder&, WebKit::AudioSessionRoutingArbitratorProxy*, void (WebKit::AudioSessionRoutingArbitratorProxy::*)(WebCore::AudioSession::CategoryType, WTF::CompletionHandler<void (WebCore::AudioSessionRoutingArbitrationClient::RoutingArbitrationError, WebCore::AudioSessionRoutingArbitrationClient::DefaultRouteChanged)>&&)) 8 0x110145047 WebKit::AudioSessionRoutingArbitratorProxy::didReceiveMessage(IPC::Connection&, IPC::Decoder&) https://build.webkit.org/#/builders/3/builds/3018/steps/12/logs/stdio
Currently, three processes are involved to begin routing arbitration. WebContent process: HTMLMediaElement changes state (canProduceAudioChanged) MediaSessionManagerCocoa sets the category of RemoteAudioSession, which sends an IPC message(RemoteAudioSessionProxy::SetCategory) to the GPU Process. GPU Process: 3. RemoteAudioSessionProxy starts the process to set the category of AudioSessionMac, which will call LocalAudioSessionRoutingArbitrator to send an IPC message (GPUProcessConnection::BeginRoutingArbitrationWithCategory) to the WebContent process. WebContent Process: 4. Send an IPC message (AudioSessionRoutingArbitratorProxy::BeginRoutingArbitrationWithCategory) to the UI process. UI Process: 5. Call SharedRoutingArbitrator::beginRoutingArbitrationWithCategoryForToken(). After the GPU Process crashes, WebContent Process: 6. Reload and resume the media playback. This will lead to the state change in step 1, after that step 2, 3, 4, 5 will run again. UI Process: 7. Clean up routing arbitrator by calling SharedRoutingArbitrator::endRoutingArbitrationForToken(). Normally, step 6 and 7 happen almost at the same time (in different processes). Step 7 will be done before steps 1, 2, 3, 4, and 5 which are triggered by step 6. However, that is not guaranteed. If step 7 is delayed for some reason, step 5 will crash with an assertion failure.
This keeps happening super frequently, roughly half of the time. Seems like the test should be removed if it cannot be fixed soon.
(In reply to Alexey Proskuryakov from comment #4) > This keeps happening super frequently, roughly half of the time. Seems like > the test should be removed if it cannot be fixed soon. Agree. I think it is a good idea to disable the test for now.
Created attachment 433960 [details] Patch
Committed r280180 (239874@main): <https://commits.webkit.org/239874@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 433960 [details].
Reopen this bug because the issue is not resolved.
*** Bug 229010 has been marked as a duplicate of this bug. ***
As far as I know, the following two tests are affected: TestWebKitAPI.WebKit2.CrashGPUProcessWhileCapturing TestWebKitAPI.GPUProcess.CrashWhilePlayingAudioViaCreateMediaElementSource
Created attachment 435382 [details] [fast-cq] Patch
Comment on attachment 435382 [details] [fast-cq] Patch The test failures are not relevant to this patch.
Committed r280951 (240457@main): <https://commits.webkit.org/240457@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 435382 [details].