[gst-devel] Deadlock in GstQueue?

iain iain at prettypeople.org
Sat Sep 7 07:40:03 CEST 2002


I have a pipeline like this (apologies for my bad ascii art)

 ____________________________________________________________________________
| GstThread                                                                  |
|                                                                            |
|  _______     ___________GstBin_______________   _____   ___   ___________  |
| |filesrc|---|  _____     __________________ /|-|queue|-|i2f|-|           | |
|  ~~~~~~~    |\|cache|---|autoplug to ele1  K | ======= ===== | Element 2 | |
|             |  ~~~~~     ~~~~~~~~~~~~~~~~~~ \|-|queue|-|i2f|-|           | |
|              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   ~~~~~   ~~~   ~~~~~~~~~~~  |
|____________________________________________________________________________|

To explain the diagram:
There's a GstThread that contains a filesrc and another GstBin, and then
some more elements.

ele1 is a plugin I wrote that takes N channel audio data and outputs N
mono channels. In the diagram it's taking a stereo stream from the cache
and outputting 2 mono streams which then become ghost pads for the
GstBin that they are sitting in.

Each of these pads is then connected to a queue and an int2float, and
then connected to Element2 which is another element I wrote that takes N
mono channels and does stuff with them.

When the pipeline is playing, ele1 pushes a load of buffers into the
queue, and then the program hangs.
Gdb'ing the hung program shows that Element 2 is calling
gst_bytestream_peek_bytes and hanging on a gst_pad_pull call and
another thread is blocking on a pthread_cond_wait in gst_queue_get.

Can anyone tell me if I'm doing something wrong, or is this a bug?

The relevant code from the application is included.
marlin-sample-small.c is just the stuff the creates the GST pipeline,
marlin-sample-element.c is Element 2 and gstoneton.c is the
implementation of ele1

thanks, and sorry for bothering you with so many dumb questions, but I
am slowly getting the hang of GStreamer :)

iain

0x4097ba02 in sigsuspend () from /lib/libc.so.6
(gdb) bt
#0  0x4097ba02 in sigsuspend () from /lib/libc.so.6
#1  0x408d9af0 in __pthread_wait_for_restart_signal (self=0x419ffc00)
    at pthread.c:967
#2  0x408d5d2c in pthread_cond_wait (cond=0x80d3ed8, mutex=0x80d3eb8)
    at restart.h:34
#3  0x403c39e4 in gst_queue_get (pad=0x80bb560) at gstqueue.c:523
#4  0x403bc517 in gst_pad_pull (pad=0x80bb350) at gstpad.c:2128
#5  0x40d5a6ec in gst_basic_scheduler_chain_wrapper (argc=0, argv=0x80c8178)
    at gstbasicscheduler.c:329
#6  0x40d5eb55 in cothread_stub () at cothreads.c:407
#7  0x40d5f026 in cothread_switch (thread=0x41800000) at cothreads.c:607
#8  0x40d5dae5 in gst_basic_scheduler_iterate (sched=0x80d3ff0)
    at gstbasicscheduler.c:1354
#9  0x403c6322 in gst_scheduler_iterate (sched=0x80d3ff0) at gstscheduler.c:615
#10 0x403a89f7 in gst_bin_iterate_func (bin=0x80b7ec0) at gstbin.c:776
#11 0x403a8b96 in gst_bin_iterate (bin=0x80b7ec0) at gstbin.c:818
#12 0x403c94cb in gst_thread_main_loop (arg=0x80b7ec0) at gstthread.c:639
#13 0x408d6e24 in pthread_start_thread_event (arg=0x419ffc00) at manager.c:274
(gdb) thread 1
[Switching to thread 1 (Thread 1024 (LWP 1795))]#0  0x40a34bf4 in poll ()
   from /lib/libc.so.6
(gdb) bt
#0  0x40a34bf4 in poll () from /lib/libc.so.6
#1  0x40909a40 in g_main_context_poll (context=0x8064ff8, timeout=-1, 
    priority=2147483647, fds=0x80b6ad8, n_fds=4) at gmain.c:2585
#2  0x40908fde in g_main_context_iterate (context=0x8064ff8, block=1, 
    dispatch=1, self=0x8055230) at gmain.c:2262
#3  0x40909700 in g_main_loop_run (loop=0x80b6ac8) at gmain.c:2487
#4  0x40585183 in gtk_main () at gtkmain.c:936
#5  0x08049ded in main (argc=2, argv=0xbffff734) at test-sample.c:117
#6  0x409695b0 in __libc_start_main () from /lib/libc.so.6
(gdb) thread 2
[Switching to thread 2 (Thread 2049 (LWP 1796))]#0  0x40a34bf4 in poll ()
   from /lib/libc.so.6
(gdb) bt
#0  0x40a34bf4 in poll () from /lib/libc.so.6
#1  0x408d6bae in __pthread_manager (arg=0xd) at manager.c:139
#2  0x408d768c in __pthread_manager_event () at manager.c:221
(gdb) thread 3
[Switching to thread 3 (Thread 1026 (LWP 1797))]#0  0x4097ba02 in sigsuspend ()
   from /lib/libc.so.6
(gdb) bt
#0  0x4097ba02 in sigsuspend () from /lib/libc.so.6
#1  0x408d9af0 in __pthread_wait_for_restart_signal (self=0x40fffc00)
    at pthread.c:967
#2  0x408d5d2c in pthread_cond_wait (cond=0x80d90a0, mutex=0x80d9080)
    at restart.h:34
#3  0x403c39e4 in gst_queue_get (pad=0x80bb668) at gstqueue.c:523
#4  0x403bc517 in gst_pad_pull (pad=0x80bb6ec) at gstpad.c:2128
#5  0x40d5a6ec in gst_basic_scheduler_chain_wrapper (argc=0, argv=0x80d9790)
    at gstbasicscheduler.c:329
#6  0x40d5eb55 in cothread_stub () at cothreads.c:407
#7  0x40d5f026 in cothread_switch (thread=0x40e40000) at cothreads.c:607
#8  0x40d5b203 in gst_basic_scheduler_gethandler_proxy (pad=0x80bb770)
    at gstbasicscheduler.c:502
#9  0x403bc517 in gst_pad_pull (pad=0x80bb7f4) at gstpad.c:2128
#10 0x4002b1a1 in gst_bytestream_get_next_buf (bs=0x80daa10)
    at bytestream.c:131
#11 0x4002b2c9 in gst_bytestream_fill_bytes (bs=0x80daa10, len=524288)
    at bytestream.c:205
#12 0x4002b4e8 in gst_bytestream_peek_bytes (bs=0x80daa10, data=0x40e9ff74, 
    len=524288) at bytestream.c:286
#13 0x40021ae3 in marlin_sample_element_sink_loop (element=0x80d4358)
    at marlin-sample-element.c:164
#14 0x40d5a3d7 in gst_basic_scheduler_loopfunc_wrapper (argc=0, argv=0x80d4358)
    at gstbasicscheduler.c:279
#15 0x40d5eb55 in cothread_stub () at cothreads.c:407
#16 0x40d5f026 in cothread_switch (thread=0x40e80000) at cothreads.c:607
#17 0x40d5dae5 in gst_basic_scheduler_iterate (sched=0x80b8d10)
    at gstbasicscheduler.c:1354
#18 0x403c6322 in gst_scheduler_iterate (sched=0x80b8d10) at gstscheduler.c:615
#19 0x403a89f7 in gst_bin_iterate_func (bin=0x80b7de0) at gstbin.c:776
#20 0x403a8b96 in gst_bin_iterate (bin=0x80b7de0) at gstbin.c:818
#21 0x403c94cb in gst_thread_main_loop (arg=0x80b7de0) at gstthread.c:639
#22 0x408d6e24 in pthread_start_thread_event (arg=0x40fffc00) at manager.c:274


-- 
"The greatest evils in the world will not be carried out by men with guns,
 but by men in suits sitting behind desks" - C. S. Lewis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: marlin-gst.tar.gz
Type: application/x-gzip
Size: 6373 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20020907/969fd0ee/attachment.bin>


More information about the gstreamer-devel mailing list