GNOME Bugzilla – Bug 787915
watchdog: race between trigger and stop causes deadlock
Last modified: 2018-11-03 14:13:41 UTC
There's a potential deadlock when a state change occurs while a timeout is triggered, the main thread holds the element lock and waits for the worker thread to finish, but the worker is stuck waiting on the element lock to be able to issue its error message on the bus. Backtraces:
+ Trace 237988
Thread 4 (Thread 0x7fa4c37fd700 (LWP 54848))
Proposed Fix: Simply unlock the object before joining the worker thread --- gst-plugins-bad/gst/debugutils/gstwatchdog.c +++ gst-plugins-bad/gst/debugutils/gstwatchdog.c @@ -297,6 +297,7 @@ NULL); g_source_attach (quit_source, watchdog->main_context); g_source_unref (quit_source); + GST_OBJECT_UNLOCK (watchdog); g_thread_join (watchdog->thread); watchdog->thread = NULL; @@ -307,7 +308,6 @@ g_main_context_unref (watchdog->main_context); watchdog->main_context = NULL; - GST_OBJECT_UNLOCK (watchdog); return TRUE; }
Thanks for the bug report and the patch! Could you attach the patch in "git format-patch" format please? https://gstreamer.freedesktop.org/documentation/contribute/index.html#how-to-submit-patches
Created attachment 360079 [details] [review] Proposed path in git format
-- 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-bad/issues/612.