GNOME Bugzilla – Bug 728596
basesrc: A lock is released without being previously locked
Last modified: 2014-04-21 07:33:17 UTC
In libs/gst/base/gstbasesrc.c:2817 the src object gets unlocked without previously being locked. Because of that the app using gstreamer gets killed because of a wrong unlock in platforms like FreeBSD. The GST_LIVE_UNLOCK at the end calls g_mutex_unlock which then call pthread_mutex_unlock. Doing that call to pthread_mutex_unlock breaks badly in some platforms. One solution would be to try to lock before unlocking. If we already hold the mutex the pthread_mutex_lock will not block. That way the unlock will not fail.
This is the backtrace of the problem:
+ Trace 233496
commit 63c17280408410d799e1c2f2ed49c5ab04cc80ae Author: Sebastian Dröge <sebastian@centricular.com> Date: Sun Apr 20 11:59:02 2014 +0200 basesrc: Make sure to always hold the LIVE_LOCK when going to the flushing label https://bugzilla.gnome.org/show_bug.cgi?id=728596
Created attachment 274752 [details] [review] Possible simple fix
Comment on attachment 274752 [details] [review] Possible simple fix This would deadlock, this is not a recursive mutex and even then you would like to have the same number of unlocks as locks overall. This is one possible fix: http://cgit.freedesktop.org/gstreamer/gstreamer/commit/?id=63c17280408410d799e1c2f2ed49c5ab04cc80ae
Thank you, does also fine.