GNOME Bugzilla – Bug 577671
[rtspsrc] deadlock on shutdown (locking order problem?)
Last modified: 2009-04-29 16:12:14 UTC
Running the test program from bug #577318 I quickly get deadlocks like this: (gdb) thread apply all bt
+ Trace 214105
which looks like a locking order problem to me: - streaming thread takes STREAMING_LOCK in _loop() - application thread in gst_rtspsrc_close(): - takes STATE_LOCK - does gst_task_stop() - takes STREAM_LOCK, waits for streaming thread to release it - streaming thread takes STATE_LOCK in _loop_interleaved(), waits for application thread to release it Not 100% sure what the correct solution is at this point, so just filing a bug for now.
Created attachment 132070 [details] [review] patch: don't take STATE_LOCK in streaming thread, use atomic ops for src->state instead Possible patch attached.
A slightly less intrusive patch, please test if this fixes things too. commit de0a2575fc277cbe18979f18c58a799376f21e49 Author: Wim Taymans <wim.taymans@collabora.co.uk> Date: Wed Apr 29 18:09:07 2009 +0200 rtspsrc: release state lock before stopping task We need to release the state lock before trying to wait for the task to end because the task might also take the lock. Fixes #577671