⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 282680 in webkit


Ignore:
Timestamp:
Sep 17, 2021, 11:57:26 AM (5 years ago)
Author:
commit-queue@webkit.org
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 <​pnormand@igalia.com> 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.
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r282677 r282680  
     12021-09-17  Philippe Normand  <pnormand@igalia.com>
     2
     3        REGRESSION(r282220): [GCC] Several flaky crashes on media/track/cue tests
     4        https://bugs.webkit.org/show_bug.cgi?id=230318
     5
     6        Reviewed by Xabier Rodriguez-Calvar.
     7
     8        * platform/glib/TestExpectations: Unflag tests no longer flaky.
     9
    1102021-09-17  Arcady Goldmints-Orlov  <agoldmints@igalia.com>
    211
  • trunk/LayoutTests/platform/glib/TestExpectations

    r282677 r282680  
    24692469webkit.org/b/230317 http/tests/privateClickMeasurement/send-attribution-conversion-request.html [ Failure ]
    24702470
    2471 webkit.org/b/230318 imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/cues.html [ Pass Crash ]
    2472 webkit.org/b/230318 imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/kind.html [ Pass Crash ]
    2473 webkit.org/b/230318 imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/label.html [ Pass Crash ]
    2474 webkit.org/b/230318 imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/language.html [ Pass Crash ]
    2475 webkit.org/b/230318 imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/oncuechange.html [ Pass Crash ]
    2476 webkit.org/b/230318 imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/removeCue.html [ Pass Crash ]
    2477 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 ]
    2478 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 ]
    2479 webkit.org/b/230318 media/track/track-cue-inline-assertion-crash.html [ Pass Crash ]
    2480 webkit.org/b/230318 media/track/track-cue-left-align.html [ Pass Crash ]
    2481 webkit.org/b/230318 media/track/track-cue-line-position.html [ Pass Crash ]
    2482 webkit.org/b/230318 media/track/track-cues-cuechange.html [ Pass Crash ]
    2483 
    24842471# End: Common failures between GTK and WPE.
    24852472
  • trunk/Source/WebCore/ChangeLog

    r282667 r282680  
     12021-09-17  Philippe Normand  <pnormand@igalia.com>
     2
     3        REGRESSION(r282220): [GCC] Several flaky crashes on media/track/cue tests
     4        https://bugs.webkit.org/show_bug.cgi?id=230318
     5
     6        Reviewed by Xabier Rodriguez-Calvar.
     7
     8        The crashes were happening because the text track(s) managed by the media element still had
     9        their client set to the media element being destroyed, so the TextTrack destructor was
     10        looping back to its client, the media element being destroyed. This is particularly an issue
     11        in GCC/Release builds, most likely undefined behavior. The proposed solution is to
     12        explicitely break the link between the media element and the tracks it manages when
     13        destroying the media element. This matches existing code as well in the same destructor
     14        (CDMClient, audio session).
     15
     16        * html/HTMLMediaElement.cpp:
     17        (WebCore::HTMLMediaElement::~HTMLMediaElement):
     18
    1192021-09-17  Sam Weinig  <weinig@apple.com>
    220
  • trunk/Source/WebCore/html/HTMLMediaElement.cpp

    r282374 r282680  
    537537
    538538    beginIgnoringTrackDisplayUpdateRequests();
     539
     540    if (m_textTracks) {
     541        for (unsigned i = 0; i < m_textTracks->length(); ++i) {
     542            auto track = m_textTracks->item(i);
     543            track->clearClient(*this);
     544        }
     545    }
     546
     547    if (m_audioTracks) {
     548        for (unsigned i = 0; i < m_audioTracks->length(); ++i) {
     549            auto track = m_audioTracks->item(i);
     550            track->clearClient(*this);
     551        }
     552    }
     553
     554    if (m_videoTracks) {
     555        for (unsigned i = 0; i < m_videoTracks->length(); ++i) {
     556            auto track = m_videoTracks->item(i);
     557            track->clearClient(*this);
     558        }
     559    }
     560
    539561    allMediaElements().remove(this);
    540562
Note: See TracChangeset for help on using the changeset viewer.