WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
260067
[MSE][GStreamer] Deadlock while flushing on paused when there's a non in-place transform element
https://bugs.webkit.org/show_bug.cgi?id=260067
Summary
[MSE][GStreamer] Deadlock while flushing on paused when there's a non in-plac...
Enrique Ocaña
Reported
2023-08-11 05:32:11 PDT
There is a deadlock possible inside WebKit media src (MSE) between streaming thread handling CAPS event and pipeline flush in the main thread. This happens in case where there is a transform element in the pipeline that does transition NOT in place. Basetransform elem expects that it will allocate buffers so on CAPS change it triggers allocation negotiations (ALLOCATION query). In such case CAPS event becomes fully synchronous as basetransform does ALLOCATION query that is synchronous (serialized with data) and may block the streaming thread. If the pipeline is paused and the sink thread doesn't accept any data, this will block CAPS event until pipeline is unpaused or flushed. But flush requires a lock that streaming thread is holding (DataMutexLocker streamingMembers { stream->streamingMembersDataMutex };) See:
https://github.com/WebPlatformForEmbedded/WPEWebKit/issues/1135
Attachments
Add attachment
proposed patch, testcase, etc.
Enrique Ocaña
Comment 1
2023-08-11 05:37:53 PDT
My proposal for this is to make webKitMediaSrcLoop() release the lock before pushing the caps event (which may take a long time to get processed) to let the main thread start the flush. Such a flush would cause the sink element to release the streaming thread and the caps event processing to finish. After the caps event has been pushed, the lock would be retaken. But streamingMembers might have changed under our feet (and it certainly will, because of the flush). We should reevaluate if the flush condition is present, and in that case abort the execution of webKitMediaSrcLoop() after having paused the streaming task of the corresponding pad.
Enrique Ocaña
Comment 2
2023-08-11 06:00:10 PDT
Pull request:
https://github.com/WebKit/WebKit/pull/16603
EWS
Comment 3
2023-08-25 06:03:39 PDT
Committed
267276@main
(5023d703877c): <
https://commits.webkit.org/267276@main
> Reviewed commits have been landed. Closing PR #16603 and removing active labels.
Radar WebKit Bug Importer
Comment 4
2023-08-25 06:04:14 PDT
<
rdar://problem/114447153
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug