GNOME Bugzilla – Bug 684658
GstVideoDecoder locking: stuck on shutdown with mewmew.mkv and assrender
Last modified: 2012-09-25 23:00:51 UTC
+++ This bug was initially created as a clone of Bug #683192 +++ For some reason mewmew-vorbis-ssa.mkv is stuck on the first frame with totem and the playback test. With totem there are invalid (-1) timestamp warnings, see bug #683189. I'm sure this used to work not too long ago, not sure what changed, might be in videodecoder. Things work though if assrender is removed from the equation. When shutting down the above, we deadlock. I wonder if locking in videodecoder is right here: it pushes out buffers while still holding the GST_VIDEO_DECODER_STREAM_LOCK, and when it gets a QoS event in another thread, it takes the object lock and waits on the STREAM_LOCK as well and is stuck, which is then the reason the sink can't shut down.
+ Trace 230892
Thread 6 (Thread 0x7fd62d325700 (LWP 10604))
Thread 1 (Thread 0x7fd644a92700 (LWP 10443))
Note that this is a blocker for the next bug-fix release, not 1.0.0
<__tim> slomo, do you have an opinion on https://bugzilla.gnome.org/show_bug.cgi?id=684658 ? <__tim> does the lock-taking look correct? <slomo> __tim: using the stream lock for upstream events sounds wrong <slomo> __tim: everything else seems correct
Created attachment 225047 [details] [review] videodecoder: don't take STREAM_LOCK on upstream events Dumb patch, question is if it should wait or not.
Created attachment 225049 [details] [review] videodecoder: don't take STREAM_LOCK on upstream events (v2) Protect qos variables with object lock in some other places as well.
Ok, pushed this for now: commit 62c111f1e481f558e9d65a8eface9877178d3051 Author: Tim-Philipp Müller <tim.muller@collabora.co.uk> Date: Mon Sep 24 10:16:09 2012 +0100 videodecoder: don't take STREAM_LOCK on upstream events Don't try to take STREAM_LOCK on upstream events such as QOS. Protect qos-related variables with object lock instead. Fixes possible deadlock when shutting down in certain situations. https://bugzilla.gnome.org/show_bug.cgi?id=684658 There's another place that needs fixing, namely the GST_QUERY_CONVERT code path, it also shouldn't take the stream lock, but I'll leave that for another time. Keeping bug open for that.
The problem is that the output_state pointer is protected by the STREAM LOCK, it should probably use the object lock and refcounting and more cleverness...
There's bug #684832 now for the remaining issue, so let's close this one then.