Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REGRESSION(r290375) [GStreamer] Deadlock in WebProcess termination if AppendPipeline is started #830

Conversation

blino
Copy link
Contributor

@blino blino commented May 20, 2022

aa4848a

REGRESSION(r290375) [GStreamer] Deadlock in WebProcess termination if AppendPipeline is started
https://bugs.webkit.org/show_bug.cgi?id=240716

Patch by Olivier Blin <olivier.blin@softathome.com > on 2022-05-23
Reviewed by Alicia Boya Garcia.

Since r290375, GStreamer ports are calling gst_deinit() at WebProcess
termination.

This is causing a deadlock if a MSE SourceBuffer has been instantiated.
That is because the GstTask from the appsrc element in the
AppendPipeline is still running.

To avoid the deadlock, stop the appsrc element in the AppendPipeline
when the SourceBuffer is removed from the MediaSource, since it will
not be useful anymore after being removed from its associated MediaSource.

The W3C spec of MediaSource.removeSourceBuffer mentions as a last step
that it should destroy all resources for sourceBuffer.

The MediaSource will be stopped at WebProcess termination, since
active DOM objects are stopped when detaching the frame.
This ensures that MediaSource is detached from its media element, and
that it removes its source buffers.

Drive-by fix: remove resetPipeline declaration, deleted in r238892

* Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::stopParser):
* Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.h:
* Source/WebCore/platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
(WebCore::SourceBufferPrivateGStreamer::removedFromMediaSource):

Canonical link: https://commits.webkit.org/250860@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@294634 268f45cc-cd09-0410-ab3c-d52691b4dbfc

@blino blino force-pushed the eng/REGRESSIONr290375-GStreamer-Deadlock-in-WebProcess-termination-if-AppendPipeline-is-started branch from 8f83e6b to 97b0caf Compare May 20, 2022 14:51
@philn philn requested a review from ntrrgc May 20, 2022 14:56
@webkit-early-warning-system webkit-early-warning-system added the merging-blocked Applied to prevent a change from being merged label May 22, 2022
Copy link
Contributor

@ntrrgc ntrrgc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@philn philn added merge-queue Applied to send a pull request to merge-queue and removed merging-blocked Applied to prevent a change from being merged labels May 23, 2022
@webkit-early-warning-system webkit-early-warning-system force-pushed the eng/REGRESSIONr290375-GStreamer-Deadlock-in-WebProcess-termination-if-AppendPipeline-is-started branch from 97b0caf to aa4848a Compare May 23, 2022 13:14
@webkit-early-warning-system webkit-early-warning-system merged commit aa4848a into WebKit:main May 23, 2022
@webkit-early-warning-system
Copy link
Collaborator

Committed r294634 (250860@main): https://commits.webkit.org/250860@main

Reviewed commits have been landed. Closing PR #830 and removing active labels.

@webkit-early-warning-system webkit-early-warning-system removed the merge-queue Applied to send a pull request to merge-queue label May 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants