After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 453369 - Deadlock involving preroll queue filling
Deadlock involving preroll queue filling
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other All
: Normal critical
: NONE
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2007-07-03 12:52 UTC by Tim Angus
Modified: 2009-04-15 22:08 UTC
See Also:
GNOME target: ---
GNOME version: 2.17/2.18


Attachments
Simple test application that may be used to reproduce the bug (2.81 KB, text/x-csrc)
2007-07-03 12:53 UTC, Tim Angus
Details
Media used in combination with the test program to produce stack trace in bug report (392.68 KB, application/x-gzip)
2007-07-03 12:56 UTC, Tim Angus
Details
FLV which when used with "gst-launch playbin uri=..." exhibits the lock (512.00 KB, application/x-flash-video)
2007-07-06 12:17 UTC, Tim Angus
Details

Description Tim Angus 2007-07-03 12:52:54 UTC
Steps to reproduce:
1. Use a playbin to play a file with more than 1 stream.
2. Enact lots of state changes.
3. Goto 2.

See attached test program to reproduce easily.

Stack trace:
Starting program: /home/tim/tmp/gst-test file:///home/tim/Desktop/sync_s.avi
[Thread debugging using libthread_db enabled]
[New Thread -1213531600 (LWP 15586)]
0 [New Thread -1215665264 (LWP 15590)]
[New Thread -1224623216 (LWP 15591)]
[New Thread -1233171568 (LWP 15592)]
EOS
1 EOS
2 EOS
3 
Program received signal SIGINT, Interrupt.
[Switching to Thread -1213531600 (LWP 15586)]
0xffffe410 in __kernel_vsyscall ()
(gdb) thread apply all bt


Other information:
Comment 1 Tim Angus 2007-07-03 12:53:43 UTC
Created attachment 91099 [details]
Simple test application that may be used to reproduce the bug
Comment 2 Tim Angus 2007-07-03 12:56:33 UTC
Created attachment 91100 [details]
Media used in combination with the test program to produce stack trace in bug report

It seems any file with more than 1 stream causes the deadlock, but this is the particular file used to reproduce the stack trace as seen in the bug report.
Comment 3 Wim Taymans 2007-07-03 16:38:46 UTC
this is quite a special case of a sink that cannot preroll because a queue is filled. The reason being that the sinks try to consume as much data as quickly as possible, which might cause one of the queue to fill up. Not quite sure how to solve this except for growing the queue even more (there must be a limit, though). It's definatly not a bug in the state changes.
Comment 4 Tim Angus 2007-07-04 15:05:10 UTC
Increasing DEFAULT_QUEUE_SIZE and the "max-size-bytes" proprty on the preroll queue in gstplaybasebin.c tends to reduce the occurrence of this bug. Increasing the sizes by a factor of about 100 seems to more or less prevent it, but obviously it uses a silly amount of memory as a result (and doesn't actually fix the bug).

  g_object_set (G_OBJECT (preroll),
      "max-size-buffers", 0, "max-size-bytes",
      ((type == GST_STREAM_TYPE_VIDEO) ? 25 : 1) * 1024 * 1024,
      "max-size-time", play_base_bin->queue_size, NULL);

For what it's worth the signal handler queue_overrun as set by

  overrun_sig = g_signal_connect (G_OBJECT (preroll), "overrun",
      G_CALLBACK (queue_overrun), play_base_bin);

in the same function doesn't seem to get called when the queue fills. I'm not sure if this is a problem? I'm fairly desperate to get this fixed; if there is any direction you can give me toward resolving this I'd really appreciate it.
Comment 5 Tim Angus 2007-07-06 12:17:47 UTC
Created attachment 91297 [details]
FLV which when used with "gst-launch playbin uri=..." exhibits the lock
Comment 6 Tim Angus 2007-07-06 12:23:00 UTC
I've managed to reproduce this without using fakesinks or any other weird usage patterns. It's just using "gst-launch playbin uri=..." with the attached FLV. It normally takes a few attempts to reproduce; usually about 5 or 6. Below is a stacktrace at the point of locking.

Starting program: /home/tim/sources/gstreamer/head/gstreamer/tools/.libs/lt-gst-launch-0.10 playbin uri=file:///home/tim/Desktop/caddon/caddon.flv
[Thread debugging using libthread_db enabled]
[New Thread -1212740880 (LWP 5180)]
Setting pipeline to PAUSED ...
[New Thread -1218626672 (LWP 5183)]
Pipeline is PREROLLING ...
[New Thread -1227236464 (LWP 5184)]
[New Thread -1235629168 (LWP 5185)]
[New Thread -1246651504 (LWP 5188)]
[New Thread -1256588400 (LWP 5190)]
[New Thread -1264981104 (LWP 5191)]

Program received signal SIGINT, Interrupt.
[Switching to Thread -1212740880 (LWP 5180)]
0xffffe410 in __kernel_vsyscall ()
(gdb) thread apply all bt

Thread 5 (Thread -1246651504 (LWP 5188))

  • #0 __kernel_vsyscall
  • #1 __lll_mutex_lock_wait
    from /lib/tls/i686/cmov/libpthread.so.0
  • #2 _L_mutex_lock_51
    from /lib/tls/i686/cmov/libpthread.so.0
  • #3 pthread_mutex_lock
    from /lib/tls/i686/cmov/libpthread.so.0
  • #4 IA__g_signal_emit_valist
    at gsignal.c line 2129
  • #5 IA__g_signal_emit
    at gsignal.c line 2243
  • #6 gst_queue_loop
    at gstqueue.c line 978
  • #7 gst_task_func
    at gsttask.c line 192
  • #8 g_thread_pool_thread_proxy
    at gthreadpool.c line 265
  • #9 g_thread_create_proxy
    at gthread.c line 591
  • #10 start_thread
    from /lib/tls/i686/cmov/libpthread.so.0
  • #11 clone
    from /lib/tls/i686/cmov/libc.so.6

Thread 3 (Thread -1227236464 (LWP 5184))

  • #0 signal_emit_unlocked_R
    at gsignal.c line 1188
  • #1 IA__g_signal_emit_valist
    at gsignal.c line 2199
  • #2 IA__g_signal_emit
    at gsignal.c line 2243
  • #3 gst_queue_loop
    at gstqueue.c line 978
  • #4 gst_task_func
    at gsttask.c line 192
  • #5 g_thread_pool_thread_proxy
    at gthreadpool.c line 265
  • #6 g_thread_create_proxy
    at gthread.c line 591
  • #7 start_thread
    from /lib/tls/i686/cmov/libpthread.so.0
  • #8 clone
    from /lib/tls/i686/cmov/libc.so.6

Comment 7 Tim Angus 2007-07-06 15:42:30 UTC
Note that the FLV is a 512Kb truncation of a larger one. I would upload the full thing but it's 15Mb; probably a bit big for bugzilla. The behaviour with respect to this bug appears to be the same however, regardless of the length used.
Comment 8 Felipe Contreras (banned) 2007-09-27 12:39:08 UTC
I'm having the same issue when I use my custom element in some application like Totem.

Somehow I'm never able to switch to back PLAYING again. It seems some sink stays ASYNC.
Comment 9 Tim-Philipp Müller 2009-04-15 22:08:54 UTC
So, umm, this is quite old. Not sure what to do about this. Closing as OBSOLETE for now, since there have been quite a few fixes even for decodebin/playbin/queue since then.

It plays fine with playbin and playbin2 for me with current git versions of things.

Please re-open if you think it's still an issue, but be advised that there are known issues with decodebin/playbin which are only fixed in decodebin2/playbin2.