GNOME Bugzilla – Bug 756828
Deadlocks in rhythmbox at the end of a song
Last modified: 2018-05-24 18:34:22 UTC
Here are the backtraces of all the threads : (gdb) thread apply all bt
+ Trace 235596
Thread 2 (Thread 0x7f7e85f13700 (LWP 2963))
Thread 1 (Thread 0x7f7ecab04ac0 (LWP 2915))
Thread 2 looks like a problem in Rhythmbox: the about-to-finish handler waits for a GCond there. And that combined with Thread 1, where Rhythmbox is shutting down the pipeline... which deadlocks because Thread 2 is waiting (from a streaming thread!) for a GCond.
Created attachment 313785 [details] [review] playbin: do not deadlock the main & streaming threads It seems GStreamer has a tendancy to deadlock if we wait for a message to be processed on the main thread from the streaming thread. Indeed the main might already be blocking on changing the state of the pipeline. Instead of waiting the end of stream message to be processed, let's just post it and give the hand back to gstreamer. This reworks the following commit : 256f7eb568dd3c4713c2a3b8e1bafe06270e7e18
That's not how about-to-finish works. You must not return from the signal handler until you set a new URI, otherwise playbin might just finish instead of playing any new URI that you set too late.
So if I understand correctly, in the about-to-finish handler, we're only allowed to set uri and suburi properties, nothing else (otherwise it might deadlock)?
You can also do other things, basically everything that you're allowed to do from a GStreamer streaming thread. In your backtraces the problem is that rhythmbox shuts down the pipeline but does not signal its *own* GCond that is blocking the streaming thread of that pipeline. Just signal it and make sure nothing is waiting in about-to-finish if you're currently shutting down.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME'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.gnome.org/GNOME/rhythmbox/issues/1421.