Title: [282680] trunk
Revision
282680
Author
[email protected]
Date
2021-09-17 11:57:26 -0700 (Fri, 17 Sep 2021)

Log Message

REGRESSION(r282220): [GCC] Several flaky crashes on media/track/cue tests
https://bugs.webkit.org/show_bug.cgi?id=230318

Patch by Philippe Normand <[email protected]> on 2021-09-17
Reviewed by Xabier Rodriguez-Calvar.

Source/WebCore:

The crashes were happening because the text track(s) managed by the media element still had
their client set to the media element being destroyed, so the TextTrack destructor was
looping back to its client, the media element being destroyed. This is particularly an issue
in GCC/Release builds, most likely undefined behavior. The proposed solution is to
explicitely break the link between the media element and the tracks it manages when
destroying the media element. This matches existing code as well in the same destructor
(CDMClient, audio session).

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::~HTMLMediaElement):

LayoutTests:

* platform/glib/TestExpectations: Unflag tests no longer flaky.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (282679 => 282680)


--- trunk/LayoutTests/ChangeLog	2021-09-17 18:57:02 UTC (rev 282679)
+++ trunk/LayoutTests/ChangeLog	2021-09-17 18:57:26 UTC (rev 282680)
@@ -1,3 +1,12 @@
+2021-09-17  Philippe Normand  <[email protected]>
+
+        REGRESSION(r282220): [GCC] Several flaky crashes on media/track/cue tests
+        https://bugs.webkit.org/show_bug.cgi?id=230318
+
+        Reviewed by Xabier Rodriguez-Calvar.
+
+        * platform/glib/TestExpectations: Unflag tests no longer flaky.
+
 2021-09-17  Arcady Goldmints-Orlov  <[email protected]>
 
         [GLIB] Update test expectations. Unreviewed test gardening.

Modified: trunk/LayoutTests/platform/glib/TestExpectations (282679 => 282680)


--- trunk/LayoutTests/platform/glib/TestExpectations	2021-09-17 18:57:02 UTC (rev 282679)
+++ trunk/LayoutTests/platform/glib/TestExpectations	2021-09-17 18:57:26 UTC (rev 282680)
@@ -2468,19 +2468,6 @@
 webkit.org/b/230317 http/tests/privateClickMeasurement/expired-attribution-report-gets-sent-on-session-start.html [ Failure ]
 webkit.org/b/230317 http/tests/privateClickMeasurement/send-attribution-conversion-request.html [ Failure ]
 
-webkit.org/b/230318 imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/cues.html [ Pass Crash ]
-webkit.org/b/230318 imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/kind.html [ Pass Crash ]
-webkit.org/b/230318 imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/label.html [ Pass Crash ]
-webkit.org/b/230318 imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/language.html [ Pass Crash ]
-webkit.org/b/230318 imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/oncuechange.html [ Pass Crash ]
-webkit.org/b/230318 imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/removeCue.html [ Pass Crash ]
-webkit.org/b/230318 imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/track/track-element/track-cues-cuechange-dynamically-created-track-element.html [ Pass Crash ]
-webkit.org/b/230318 imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/track/track-element/track-cues-enter-seeking.html [ Pass Crash ]
-webkit.org/b/230318 media/track/track-cue-inline-assertion-crash.html [ Pass Crash ]
-webkit.org/b/230318 media/track/track-cue-left-align.html [ Pass Crash ]
-webkit.org/b/230318 media/track/track-cue-line-position.html [ Pass Crash ]
-webkit.org/b/230318 media/track/track-cues-cuechange.html [ Pass Crash ]
-
 # End: Common failures between GTK and WPE.
 
 #////////////////////////////////////////////////////////////////////////////////////////

Modified: trunk/Source/WebCore/ChangeLog (282679 => 282680)


--- trunk/Source/WebCore/ChangeLog	2021-09-17 18:57:02 UTC (rev 282679)
+++ trunk/Source/WebCore/ChangeLog	2021-09-17 18:57:26 UTC (rev 282680)
@@ -1,3 +1,21 @@
+2021-09-17  Philippe Normand  <[email protected]>
+
+        REGRESSION(r282220): [GCC] Several flaky crashes on media/track/cue tests
+        https://bugs.webkit.org/show_bug.cgi?id=230318
+
+        Reviewed by Xabier Rodriguez-Calvar.
+
+        The crashes were happening because the text track(s) managed by the media element still had
+        their client set to the media element being destroyed, so the TextTrack destructor was
+        looping back to its client, the media element being destroyed. This is particularly an issue
+        in GCC/Release builds, most likely undefined behavior. The proposed solution is to
+        explicitely break the link between the media element and the tracks it manages when
+        destroying the media element. This matches existing code as well in the same destructor
+        (CDMClient, audio session).
+
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::~HTMLMediaElement):
+
 2021-09-17  Sam Weinig  <[email protected]>
 
         Add MIME type and URL to WebCore::Model to allow processing different model types

Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (282679 => 282680)


--- trunk/Source/WebCore/html/HTMLMediaElement.cpp	2021-09-17 18:57:02 UTC (rev 282679)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp	2021-09-17 18:57:26 UTC (rev 282680)
@@ -536,6 +536,28 @@
     ALWAYS_LOG(LOGIDENTIFIER);
 
     beginIgnoringTrackDisplayUpdateRequests();
+
+    if (m_textTracks) {
+        for (unsigned i = 0; i < m_textTracks->length(); ++i) {
+            auto track = m_textTracks->item(i);
+            track->clearClient(*this);
+        }
+    }
+
+    if (m_audioTracks) {
+        for (unsigned i = 0; i < m_audioTracks->length(); ++i) {
+            auto track = m_audioTracks->item(i);
+            track->clearClient(*this);
+        }
+    }
+
+    if (m_videoTracks) {
+        for (unsigned i = 0; i < m_videoTracks->length(); ++i) {
+            auto track = m_videoTracks->item(i);
+            track->clearClient(*this);
+        }
+    }
+
     allMediaElements().remove(this);
 
     setShouldDelayLoadEvent(false);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to