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 757337 - adaptivedemux: release manifest lock before sending flush stop event
adaptivedemux: release manifest lock before sending flush stop event
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: 1.7.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-10-29 23:59 UTC by Florin Apostol
Modified: 2015-10-30 13:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed patch (1.80 KB, patch)
2015-10-30 00:04 UTC, Florin Apostol
committed Details | Review

Description Florin Apostol 2015-10-29 23:59:13 UTC
sending flush stop event will serialiase on stream->src_srcpad.
But the _src_chain function will first get the pad lock and then the
manifest lock, so we cannot hold the manifest lock while sending the flush stop event (taking locks in reverse order will lead to deadlock)

In conclusion, we need to release the manifest lock before flushing.
Comment 1 Florin Apostol 2015-10-30 00:04:55 UTC
Created attachment 314432 [details] [review]
proposed patch
Comment 2 Florin Apostol 2015-10-30 11:14:33 UTC
Vincent, can you please review and merge this?
Comment 3 Vincent Penquerc'h 2015-10-30 11:17:24 UTC
Yes, I have them merged locally, they're about to go in, except I'm getting audio corruption which I've just tracked to https://bugzilla.gnome.org/show_bug.cgi?id=757351. I'm about to test with a slightly older -base, and will push once that's done.
Comment 4 Vincent Penquerc'h 2015-10-30 11:18:23 UTC
Also, I was wondering whether it'd be best to have both the flush-start and flush-stop out of the lock, even though there is no hook for flush-start that really requires it.
Comment 5 Vincent Penquerc'h 2015-10-30 11:43:16 UTC
commit e0ef33542604ba81259bd62ea6d3c1b12a85ecf7
Author: Florin Apostol <florin.apostol@oregan.net>
Date:   Fri Oct 30 00:04:12 2015 +0000

    adaptivedemux: release manifest lock before sending flush stop event
    
    https://bugzilla.gnome.org/show_bug.cgi?id=757337
Comment 6 Florin Apostol 2015-10-30 11:45:04 UTC
(In reply to Vincent Penquerc'h from comment #4)
> Also, I was wondering whether it'd be best to have both the flush-start and
> flush-stop out of the lock, even though there is no hook for flush-start
> that really requires it.

I took the approach to keep the lock as much as possible and document each need to release it. My assumption is that there are only a few of these exceptions so the code will be more maintainable.
Comment 7 Nicolas Dufresne (ndufresne) 2015-10-30 13:28:23 UTC
In case this introduced a race, an approach used at other places is to take the stream lock, then release the internal lock, and then sending flush stop, this would imply the internal lock to never be taken after the stream lock (like in chain function) though.