GNOME Bugzilla – Bug 686420
gstqueue plugin will become deadlock in some citical cases
Last modified: 2012-12-03 06:35:03 UTC
In my app , I create a playbin to play mms stations, such as mms://03vl.sina.com.cn/cnr003. And after one minute, I want to change the play station, so I called gst_element_set_state(playbin, GST_STATE_NULL); For most cases, it works ok, But in some critical cases, such as When in wifi network, network is critical bad, it will hang. I use gdb to debug, and found it is a deadlock by gstqueue. This is the thread that I call stop cmd. (gdb) thread 2 [Switching to thread 2 (Thread 461)] (gdb) bt
+ Trace 231067
From this we can see that thread 10 is waiting for thread 2 to finished. But thread 2 is wait for adding. This are codes of frame 2 inThread 2 : while (gst_queue_is_empty (queue)) { GST_QUEUE_WAIT_ADD_CHECK (queue, out_flushing); } I think in some cases that "g_cond_signal (&queue->item_add);" is not called. But I don't kown how to handle this. Hope to your help.
Can anybody give me some help ? Dear Tim-Philipp Müller and Wim Taymans, come out please.
zhangyanping: Please be patient. Obviously developers don't provide user support within 3 hours at any time of the day in any timezone. Please provide a minimal testcase here so we don't have to guess steps, and please provide information about your EXACT gstreamer version.
Thank you André. Because this case happens at a small probability event. So even I provide the test case, it would be little help. I provide the callstack of the case, and could you take an eye on it. I will continue to test it myself and I just want to get some advice form you.
What is the exact version of GStreamer core and gst-plugins-base that you are using? Even small probability events can eventually be reproduced, you just need to repeat them often enough in a loop :-)
zhangyanping: ping?
Thank you Tim. I am sorry to reply to you so late. I have checked the problems. I run gstreamer as a media player in my embeded device. And it will play thousands of media in a playlist. The memory for user space is only 64MB. So if I run it for hours, there will be memory fragmentation and memory leak, and gstreamer can not create thread. At this time, if I want to stop the pipeline, it will in deadlock because the thread do not exist. And the gstreamer verison I am using now is 0.11.3. I am not sure if this version has the problem of memory leaks. But according to my tests, it exists. So I am planning to swtich to the latest version of gstreamer. Thanks again.
Thanks for getting back to us. 64MB, I bet that brings out some interesting issues :) You should definitely upgrade to a 1.x version of GStreamer (to which 0.11.x was the precursor), I don't think this issue will be fixed there. However, it still sounds like something that should be fixed somewhere. Next time it dead locks, perhaps you could get a strack trace from all threads?
(In reply to comment #7) > Thanks for getting back to us. > > 64MB, I bet that brings out some interesting issues :) > > You should definitely upgrade to a 1.x version of GStreamer (to which 0.11.x > was the precursor), I don't think this issue will be fixed there. > > However, it still sounds like something that should be fixed somewhere. Next > time it dead locks, perhaps you could get a strack trace from all threads? OK, Tim, I will remember this thing.