After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 764725 - splitmuxsink: deadlock on stream error
splitmuxsink: deadlock on stream error
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
unspecified
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-04-07 13:25 UTC by Xavier Claessens
Modified: 2018-11-03 15:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
splitmux: unblock on stream error (902 bytes, patch)
2016-04-07 13:35 UTC, Xavier Claessens
needs-work Details | Review

Description Xavier Claessens 2016-04-07 13:25:30 UTC
splitmuxsink blocks streaming threads in handle_mq_input() but won't unblock them when there is a stream error. Since it won't receive any buffer after that, its blocked forever.
Comment 1 Xavier Claessens 2016-04-07 13:35:30 UTC
Created attachment 325539 [details] [review]
splitmux: unblock on stream error
Comment 2 Xavier Claessens 2016-04-08 08:31:30 UTC
Hm, bus_handler() was not what I though. I don't know if an element can have access to pipeline bus?
Comment 3 Tim-Philipp Müller 2016-04-08 08:45:18 UTC
What element generates the error here? Is it a child of splitmuxsink?

Can you make a unit test? (e.g. with identity error-after=N)
Comment 4 Xavier Claessens 2016-04-08 10:25:12 UTC
Upstream is a RTSP src, stream error can happen on network errors for example.
Comment 5 Tim-Philipp Müller 2016-04-08 10:31:00 UTC
In that case the pad block should be removed in the downward state change I guess?
Comment 6 Xavier Claessens 2016-04-08 11:28:49 UTC
Thinking a bit more about it, maybe it's a bug in my side actually. Splitmuxsink unblock streaming threads when receiving EOS on the reference pad, or when state change to READY or NULL. So I think the proper thing to do is sending eos on every pads when there is a StreamError coming from upstream.

What my code is currently doing is first gst_element_release_request_pad() on splitmuxsink's pads before changing its state to NULL. But releasing the pad, takes the pad lock which is already held by the pad probe that blocks in handle_mq_input(). So that deadlock.

I changed my code to first send EOS on each pad, then releasing request pads, then setting state to NULL, and it seems to work like that.

So maybe this bug is INVALID, it's up to the user (me) to handle stream errors correctly?
Comment 7 GStreamer system administrator 2018-11-03 15:08:54 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/issues/268.