GNOME Bugzilla – Bug 796935
parsebin: Add missing locks/unlocks of the chain mutex
Last modified: 2018-10-28 17:05:24 UTC
I don't know if this patch is correct or will introduce deadlocks elsewhere. The same was solved in decodebin at some point and needs to be properly fixed in parsebin too now in the new context.
Created attachment 373288 [details] [review] parsebin: Add missing locks/unlocks of the chain mutex Before freeing pending pads it is required to hold the mutex, that's what is protecting the list of pending pads in other places.
Created attachment 373290 [details] parsebin.c Testcase, takes ms timeout as first argument and a filename/path as second. After the timeout the pipeline is shut down. What value to take for the timeout depends on the machine, a couple of tens of ms. Without the patch there are all kinds of crashes and assertions happening. With the patch there is sometimes still a problem with something erroring out because of "not-linked" after the parser but I'll debug that separately.
The patch seems to cause deadlocks sometimes. Holding the chain mutex is a bad idea while adding pads or otherwise emitting signals or taking any stream lock.
+ Trace 238675
Thread 2 (Thread 0x7f64864b4700 (LWP 16251))
Attachment 373288 [details] pushed as 596a4ee - parsebin: Add missing locks/unlocks of the chain mutex