Title: [280951] trunk
Revision
280951
Author
[email protected]
Date
2021-08-11 18:11:15 -0700 (Wed, 11 Aug 2021)

Log Message

[ BigSur Debug ] TestWebKitAPI.GPUProcess.CrashWhilePlayingAudioViaCreateMediaElementSource is flaky, hitting ASSERTION FAILED: !isInRoutingArbitrationForToken(token)
https://bugs.webkit.org/show_bug.cgi?id=227728
<rdar://problem/80237464>

Reviewed by Jer Noble.

Source/WebKit:

After the GPU process crashes, the UI process will clean up the
`SharedRoutingArbitrator`, while a WebContent process might be resuming
the media playback and setup `AudioSessionRoutingArbitrator`.
There is a race condition here. If the WebContent process runs faster,
`SharedRoutingArbitrator` in the UI process will try to begin a duplicated
routing arbitration and lead to an assertion failure.

No new tests. Fixed following two API test failures:
- TestWebKitAPI.WebKit2.CrashGPUProcessWhileCapturing
- TestWebKitAPI.GPUProcess.CrashWhilePlayingAudioViaCreateMediaElementSource

* UIProcess/Media/cocoa/AudioSessionRoutingArbitratorProxyCocoa.mm:
(WebKit::AudioSessionRoutingArbitratorProxy::processDidTerminate):
* WebProcess/GPU/GPUProcessConnection.cpp:
(WebKit::GPUProcessConnection::didClose):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/GPUProcess.mm:
(TEST):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (280950 => 280951)


--- trunk/Source/WebKit/ChangeLog	2021-08-12 01:00:39 UTC (rev 280950)
+++ trunk/Source/WebKit/ChangeLog	2021-08-12 01:11:15 UTC (rev 280951)
@@ -1,5 +1,29 @@
 2021-08-11  Peng Liu  <[email protected]>
 
+        [ BigSur Debug ] TestWebKitAPI.GPUProcess.CrashWhilePlayingAudioViaCreateMediaElementSource is flaky, hitting ASSERTION FAILED: !isInRoutingArbitrationForToken(token)
+        https://bugs.webkit.org/show_bug.cgi?id=227728
+        <rdar://problem/80237464>
+
+        Reviewed by Jer Noble.
+
+        After the GPU process crashes, the UI process will clean up the
+        `SharedRoutingArbitrator`, while a WebContent process might be resuming
+        the media playback and setup `AudioSessionRoutingArbitrator`.
+        There is a race condition here. If the WebContent process runs faster,
+        `SharedRoutingArbitrator` in the UI process will try to begin a duplicated
+        routing arbitration and lead to an assertion failure.
+
+        No new tests. Fixed following two API test failures:
+        - TestWebKitAPI.WebKit2.CrashGPUProcessWhileCapturing
+        - TestWebKitAPI.GPUProcess.CrashWhilePlayingAudioViaCreateMediaElementSource
+
+        * UIProcess/Media/cocoa/AudioSessionRoutingArbitratorProxyCocoa.mm:
+        (WebKit::AudioSessionRoutingArbitratorProxy::processDidTerminate):
+        * WebProcess/GPU/GPUProcessConnection.cpp:
+        (WebKit::GPUProcessConnection::didClose):
+
+2021-08-11  Peng Liu  <[email protected]>
+
         [BigSur] TestWebKitAPI.AudioRoutingArbitration.Updating fails after r280726
         https://bugs.webkit.org/show_bug.cgi?id=228966
 

Modified: trunk/Source/WebKit/UIProcess/Media/cocoa/AudioSessionRoutingArbitratorProxyCocoa.mm (280950 => 280951)


--- trunk/Source/WebKit/UIProcess/Media/cocoa/AudioSessionRoutingArbitratorProxyCocoa.mm	2021-08-12 01:00:39 UTC (rev 280950)
+++ trunk/Source/WebKit/UIProcess/Media/cocoa/AudioSessionRoutingArbitratorProxyCocoa.mm	2021-08-12 01:11:15 UTC (rev 280951)
@@ -52,8 +52,6 @@
 
 void AudioSessionRoutingArbitratorProxy::processDidTerminate()
 {
-    if (SharedRoutingArbitrator::sharedInstance().isInRoutingArbitrationForToken(m_token))
-        endRoutingArbitration();
 }
 
 void AudioSessionRoutingArbitratorProxy::beginRoutingArbitrationWithCategory(WebCore::AudioSession::CategoryType category, ArbitrationCallback&& callback)

Modified: trunk/Source/WebKit/WebProcess/GPU/GPUProcessConnection.cpp (280950 => 280951)


--- trunk/Source/WebKit/WebProcess/GPU/GPUProcessConnection.cpp	2021-08-12 01:00:39 UTC (rev 280950)
+++ trunk/Source/WebKit/WebProcess/GPU/GPUProcessConnection.cpp	2021-08-12 01:11:15 UTC (rev 280951)
@@ -127,6 +127,11 @@
     auto protector = makeRef(*this);
     WebProcess::singleton().gpuProcessConnectionClosed(*this);
 
+#if ENABLE(ROUTING_ARBITRATION)
+    if (auto* arbitrator = WebProcess::singleton().supplement<AudioSessionRoutingArbitrator>())
+        arbitrator->leaveRoutingAbritration();
+#endif
+
     auto clients = m_clients;
     for (auto& client : clients)
         client.gpuProcessConnectionDidClose(*this);

Modified: trunk/Tools/ChangeLog (280950 => 280951)


--- trunk/Tools/ChangeLog	2021-08-12 01:00:39 UTC (rev 280950)
+++ trunk/Tools/ChangeLog	2021-08-12 01:11:15 UTC (rev 280951)
@@ -1,3 +1,14 @@
+2021-08-11  Peng Liu  <[email protected]>
+
+        [ BigSur Debug ] TestWebKitAPI.GPUProcess.CrashWhilePlayingAudioViaCreateMediaElementSource is flaky, hitting ASSERTION FAILED: !isInRoutingArbitrationForToken(token)
+        https://bugs.webkit.org/show_bug.cgi?id=227728
+        <rdar://problem/80237464>
+
+        Reviewed by Jer Noble.
+
+        * TestWebKitAPI/Tests/WebKitCocoa/GPUProcess.mm:
+        (TEST):
+
 2021-08-11  Youenn Fablet  <[email protected]>
 
         Media element is not always autoplaying when going from background to foreground if it is initially not in viewport

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/GPUProcess.mm (280950 => 280951)


--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/GPUProcess.mm	2021-08-12 01:00:39 UTC (rev 280950)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/GPUProcess.mm	2021-08-12 01:11:15 UTC (rev 280951)
@@ -368,8 +368,7 @@
     EXPECT_EQ(webViewPID, [webView _webProcessIdentifier]);
 }
 
-// FIXME: Re-enable this test once <rdar://80237464> is resolved
-TEST(GPUProcess, DISABLED_CrashWhilePlayingAudioViaCreateMediaElementSource)
+TEST(GPUProcess, CrashWhilePlayingAudioViaCreateMediaElementSource)
 {
     auto configuration = adoptNS([[WKWebViewConfiguration alloc] init]);
     WKPreferencesSetBoolValueForKeyForTesting((__bridge WKPreferencesRef)[configuration preferences], true, WKStringCreateWithUTF8CString("UseGPUProcessForMediaEnabled"));
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to