Changeset 275516 in webkit


Ignore:
Timestamp:
Apr 6, 2021 7:37:27 AM (3 years ago)
Author:
commit-queue@webkit.org
Message:

REGRESSION(r274358) [GStreamer] http/tests/images/mp4-partial-load.html is flaky crashing inside GStreamer
https://bugs.webkit.org/show_bug.cgi?id=223636

Patch by Philippe Normand <pnormand@igalia.com> on 2021-04-06
Reviewed by Carlos Alberto Lopez Perez.

Source/WebCore:

Ensure the GStreamer messages are always processed synchronously, even when the handler is
called from another thread. Without blocking in the latter case, the select-streams event
might be sent to decodebin too late. It has to be sent as a synchronous reaction to the
stream-collection message.

  • platform/graphics/gstreamer/ImageDecoderGStreamer.cpp:

(WebCore::ImageDecoderGStreamer::InnerDecoder::handleMessage):
(WebCore::ImageDecoderGStreamer::InnerDecoder::preparePipeline):

  • platform/graphics/gstreamer/ImageDecoderGStreamer.h:

LayoutTests:

  • platform/glib/TestExpectations: Update tests expectations.
  • platform/gtk/TestExpectations: Ditto.
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r275515 r275516  
     12021-04-06  Philippe Normand  <pnormand@igalia.com>
     2
     3        REGRESSION(r274358) [GStreamer] http/tests/images/mp4-partial-load.html is flaky crashing inside GStreamer
     4        https://bugs.webkit.org/show_bug.cgi?id=223636
     5
     6        Reviewed by Carlos Alberto Lopez Perez.
     7
     8        * platform/glib/TestExpectations: Update tests expectations.
     9        * platform/gtk/TestExpectations: Ditto.
     10
    1112021-04-06  Zalan Bujtas  <zalan@apple.com>
    212
  • trunk/LayoutTests/platform/glib/TestExpectations

    r275514 r275516  
    585585webkit.org/b/207723 http/tests/contentextensions/hide-on-ping-with-ping-that-redirects.html [ Pass Failure ]
    586586
    587 webkit.org/b/217961 webkit.org/b/223636 http/tests/images/mp4-partial-load.html [ Crash Timeout Pass ]
     587webkit.org/b/217961 http/tests/images/mp4-partial-load.html [ Timeout Pass ]
    588588
    589589webkit.org/b/224109 http/tests/privateClickMeasurement/store-private-click-measurement-with-source-nonce.html [ Failure Pass ]
     
    20462046
    20472047webkit.org/b/155196 security/contentSecurityPolicy/video-with-file-url-allowed-by-media-src-star.html [ ImageOnlyFailure Pass ]
    2048 webkit.org/b/224107 fast/images/animated-image-mp4-crash.html [ Crash Timeout Pass ]
    20492048webkit.org/b/224114 imported/w3c/web-platform-tests/wasm/webapi/instantiateStreaming-bad-imports.any.worker.html [ Failure Pass ]
    20502049webkit.org/b/224115 imported/w3c/web-platform-tests/service-workers/service-worker/unregister-immediately-before-installed.https.html [ Failure Pass ]
  • trunk/LayoutTests/platform/gtk/TestExpectations

    r275499 r275516  
    15741574webkit.org/b/224108 gamepad/gamepad-visibility-1.html [ Failure Pass ]
    15751575
    1576 webkit.org/b/224112 media/video-as-img-output-pts.html [ Crash Timeout Pass ]
    1577 
    15781576webkit.org/b/224117 intersection-observer/intersection-observer-keeps-js-wrapper-of-target-alive.html [ Failure Pass ]
    15791577
  • trunk/Source/WebCore/ChangeLog

    r275515 r275516  
     12021-04-06  Philippe Normand  <pnormand@igalia.com>
     2
     3        REGRESSION(r274358) [GStreamer] http/tests/images/mp4-partial-load.html is flaky crashing inside GStreamer
     4        https://bugs.webkit.org/show_bug.cgi?id=223636
     5
     6        Reviewed by Carlos Alberto Lopez Perez.
     7
     8        Ensure the GStreamer messages are always processed synchronously, even when the handler is
     9        called from another thread. Without blocking in the latter case, the select-streams event
     10        might be sent to decodebin too late. It has to be sent as a synchronous reaction to the
     11        stream-collection message.
     12
     13        * platform/graphics/gstreamer/ImageDecoderGStreamer.cpp:
     14        (WebCore::ImageDecoderGStreamer::InnerDecoder::handleMessage):
     15        (WebCore::ImageDecoderGStreamer::InnerDecoder::preparePipeline):
     16        * platform/graphics/gstreamer/ImageDecoderGStreamer.h:
     17
    1182021-04-06  Zalan Bujtas  <zalan@apple.com>
    219
  • trunk/Source/WebCore/platform/graphics/gstreamer/ImageDecoderGStreamer.cpp

    r274358 r275516  
    3434#include <wtf/MainThread.h>
    3535#include <wtf/Optional.h>
     36#include <wtf/Scope.h>
    3637#include <wtf/Threading.h>
    3738
     
    303304    ASSERT(&m_runLoop == &RunLoop::current());
    304305
     306    auto scopeExit = makeScopeExit([protectedThis = makeWeakPtr(this)] {
     307        if (!protectedThis)
     308            return;
     309        LockHolder lock(protectedThis->m_messageLock);
     310        protectedThis->m_messageDispatched = true;
     311        protectedThis->m_messageCondition.notifyOne();
     312    });
     313
    305314    GUniqueOutPtr<GError> error;
    306315    GUniqueOutPtr<gchar> debug;
     
    322331        GRefPtr<GstStreamCollection> collection;
    323332        gst_message_parse_stream_collection(message, &collection.outPtr());
    324         if (collection) {
     333        if (collection && GST_MESSAGE_SRC(message) == GST_OBJECT_CAST(m_decodebin.get())) {
    325334            unsigned size = gst_stream_collection_get_size(collection.get());
    326335            GList* streams = nullptr;
     
    355364    gst_bus_set_sync_handler(bus.get(), [](GstBus*, GstMessage* message, gpointer userData) {
    356365        auto& decoder = *static_cast<ImageDecoderGStreamer::InnerDecoder*>(userData);
     366
     367        {
     368            LockHolder lock(decoder.m_messageLock);
     369            decoder.m_messageDispatched = false;
     370            decoder.m_messageCondition.notifyOne();
     371        }
    357372        if (&decoder.m_runLoop == &RunLoop::current())
    358373            decoder.handleMessage(message);
     
    364379                    weakThis->handleMessage(protectedMessage.get());
    365380            });
     381        }
     382        if (!decoder.m_messageDispatched) {
     383            LockHolder lock(decoder.m_messageLock);
     384            decoder.m_messageCondition.wait(decoder.m_messageLock);
    366385        }
    367386        gst_message_unref(message);
  • trunk/Source/WebCore/platform/graphics/gstreamer/ImageDecoderGStreamer.h

    r274358 r275516  
    114114        GRefPtr<GstElement> m_decodebin;
    115115        RunLoop& m_runLoop;
     116
     117        Condition m_messageCondition;
     118        Lock m_messageLock;
     119        bool m_messageDispatched { false };
    116120    };
    117121
Note: See TracChangeset for help on using the changeset viewer.