[Bug 731015] New: v4l2src: deadlock on shutdown

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Fri May 30 13:46:10 PDT 2014


https://bugzilla.gnome.org/show_bug.cgi?id=731015
  GStreamer | gst-plugins-good | git

           Summary: v4l2src: deadlock on shutdown
    Classification: Platform
           Product: GStreamer
           Version: git
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: gst-plugins-good
        AssignedTo: gstreamer-bugs at lists.freedesktop.org
        ReportedBy: thiagossantos at gmail.com
         QAContact: gstreamer-bugs at lists.freedesktop.org
     GNOME version: ---


When testing the pipeline:

gst-launch-1.0 v4l2src ! videoconvert ! queue ! motioncells ! queue !
videoconvert ! autovideosink

the video freezes at startup and trying to shutdown the pipeline deadlocks. I
couldn't figure out much from the bt and using GST_DEBUG makes it work. Not
sure why qbuf/dqbuf aren't running as dqbuf should be waiting for buffers to be
available but qbuf is waiting for some lock to be released.

Thread 11 (Thread 0x7fffc4bb2700 (LWP 10267)):
#0  syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1  0x00007ffff020504b in ?? () from /usr/lib/libtbb.so.2
#2  0x00007ffff0205069 in ?? () from /usr/lib/libtbb.so.2
#3  0x00007ffff6f59062 in start_thread (arg=0x7fffc4bb2700) at
pthread_create.c:312
#4  0x00007ffff6c8cc1d in clone () at
../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 10 (Thread 0x7fffc47b1700 (LWP 10268)):
#0  syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1  0x00007ffff020504b in ?? () from /usr/lib/libtbb.so.2
#2  0x00007ffff0205069 in ?? () from /usr/lib/libtbb.so.2
#3  0x00007ffff6f59062 in start_thread (arg=0x7fffc47b1700) at
pthread_create.c:312
#4  0x00007ffff6c8cc1d in clone () at
../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 9 (Thread 0x7fffc4fb3700 (LWP 10266)):
#0  syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1  0x00007ffff020504b in ?? () from /usr/lib/libtbb.so.2
#2  0x00007ffff0205069 in ?? () from /usr/lib/libtbb.so.2
#3  0x00007ffff6f59062 in start_thread (arg=0x7fffc4fb3700) at
pthread_create.c:312
#4  0x00007ffff6c8cc1d in clone () at
../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 8 (Thread 0x7fffc5fff700 (LWP 10265)):
#0  pthread_cond_timedwait@@GLIBC_2.3.2 () at
../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:238
#1  0x00007ffff73fccf5 in g_cond_wait_until (cond=cond at entry=0x621cb8,
mutex=mutex at entry=0x621cb0, end_time=end_time at entry=15118734755)
    at /tmp/buildd/glib2.0-2.40.0/./glib/gthread-posix.c:898
#2  0x00007ffff73911c1 in g_async_queue_pop_intern_unlocked
(queue=queue at entry=0x621cb0, wait=wait at entry=1,
end_time=end_time at entry=15118734755)
    at /tmp/buildd/glib2.0-2.40.0/./glib/gasyncqueue.c:422
#3  0x00007ffff739174b in g_async_queue_timeout_pop (queue=0x621cb0,
timeout=timeout at entry=15000000)
    at /tmp/buildd/glib2.0-2.40.0/./glib/gasyncqueue.c:543
#4  0x00007ffff73e0966 in g_thread_pool_wait_for_new_pool () at
/tmp/buildd/glib2.0-2.40.0/./glib/gthreadpool.c:167
#5  g_thread_pool_thread_proxy (data=<optimized out>) at
/tmp/buildd/glib2.0-2.40.0/./glib/gthreadpool.c:364
#6  0x00007ffff73dff15 in g_thread_proxy (data=0x7fffd00038f0) at
/tmp/buildd/glib2.0-2.40.0/./glib/gthread.c:764
#7  0x00007ffff6f59062 in start_thread (arg=0x7fffc5fff700) at
pthread_create.c:312
---Type <return> to continue, or q <return> to quit---
#8  0x00007ffff6c8cc1d in clone () at
../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 7 (Thread 0x7fffddc62700 (LWP 10264)):
#0  0x00007ffff6c8190d in poll () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007ffff73bafe4 in g_main_context_poll (priority=2147483647, n_fds=1,
fds=0x7fffcc0008c0, timeout=-1, context=0x883d20)
    at /tmp/buildd/glib2.0-2.40.0/./glib/gmain.c:4028
#2  g_main_context_iterate (context=context at entry=0x883d20,
block=block at entry=1, dispatch=dispatch at entry=1, self=<optimized out>)
    at /tmp/buildd/glib2.0-2.40.0/./glib/gmain.c:3729
#3  0x00007ffff73bb0ec in g_main_context_iteration (context=0x883d20,
may_block=may_block at entry=1) at /tmp/buildd/glib2.0-2.40.0/./glib/gmain.c:3795
#4  0x00007ffff73bb129 in glib_worker_main (data=<optimized out>) at
/tmp/buildd/glib2.0-2.40.0/./glib/gmain.c:5541
#5  0x00007ffff73dff15 in g_thread_proxy (data=0x864050) at
/tmp/buildd/glib2.0-2.40.0/./glib/gthread.c:764
#6  0x00007ffff6f59062 in start_thread (arg=0x7fffddc62700) at
pthread_create.c:312
#7  0x00007ffff6c8cc1d in clone () at
../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 6 (Thread 0x7fffde463700 (LWP 10263)):
#0  syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1  0x00007ffff545a390 in ?? () from
/usr/lib/x86_64-linux-gnu/libv4lconvert.so.0
#2  0x00007ffff5958f2e in ?? () from /usr/lib/x86_64-linux-gnu/libv4l2.so.0
#3  0x00007ffff595a8dc in v4l2_ioctl () from
/usr/lib/x86_64-linux-gnu/libv4l2.so.0
#4  0x00007ffff6214b95 in gst_v4l2_allocator_dqbuf (allocator=0x7fffc80100e0)
at gstv4l2allocator.c:1283
#5  0x00007ffff621f71a in gst_v4l2_buffer_pool_dqbuf
(pool=pool at entry=0x7fffc800e150, buffer=buffer at entry=0x7fffde462ce0) at
gstv4l2bufferpool.c:1027
#6  0x00007ffff62201cb in gst_v4l2_buffer_pool_acquire_buffer
(bpool=0x7fffc800e150, buffer=0x7fffde462ce0, params=0x0) at
gstv4l2bufferpool.c:1132
#7  0x00007ffff7b0a542 in gst_buffer_pool_acquire_buffer (pool=0x7fffc800e150,
buffer=0x7fffde462ce0, params=0x0) at gstbufferpool.c:1206
#8  0x00007ffff6224172 in gst_v4l2src_create (src=0x7a83c0, buf=0x7fffde462ce0)
at gstv4l2src.c:624
#9  0x00007ffff5b8fb75 in gst_base_src_get_range (src=src at entry=0x7a83c0,
offset=offset at entry=18446744073709551615, length=length at entry=4096, 
    buf=buf at entry=0x7fffde462de8) at gstbasesrc.c:2445
#10 0x00007ffff5b9159b in gst_base_src_loop (pad=0x7aa0d0) at gstbasesrc.c:2721
#11 0x00007ffff7b64599 in gst_task_func (task=0x882290) at gsttask.c:317
#12 0x00007ffff73e089c in g_thread_pool_thread_proxy (data=<optimized out>) at
/tmp/buildd/glib2.0-2.40.0/./glib/gthreadpool.c:307
#13 0x00007ffff73dff15 in g_thread_proxy (data=0x864280) at
/tmp/buildd/glib2.0-2.40.0/./glib/gthread.c:764
#14 0x00007ffff6f59062 in start_thread (arg=0x7fffde463700) at
pthread_create.c:312
#15 0x00007ffff6c8cc1d in clone () at
../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 5 (Thread 0x7fffdec64700 (LWP 10262)):
---Type <return> to continue, or q <return> to quit---
#0  pthread_cond_wait@@GLIBC_2.3.2 () at
../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007ffff73fcc07 in g_cond_wait (cond=cond at entry=0x7c4370,
mutex=mutex at entry=0x7c4360) at
/tmp/buildd/glib2.0-2.40.0/./glib/gthread-posix.c:762
#2  0x00007ffff4bdacfd in gst_queue_loop (pad=<optimized out>) at
gstqueue.c:1235
#3  0x00007ffff7b64599 in gst_task_func (task=0x882170) at gsttask.c:317
#4  0x00007ffff73e089c in g_thread_pool_thread_proxy (data=<optimized out>) at
/tmp/buildd/glib2.0-2.40.0/./glib/gthreadpool.c:307
#5  0x00007ffff73dff15 in g_thread_proxy (data=0x8640f0) at
/tmp/buildd/glib2.0-2.40.0/./glib/gthread.c:764
#6  0x00007ffff6f59062 in start_thread (arg=0x7fffdec64700) at
pthread_create.c:312
#7  0x00007ffff6c8cc1d in clone () at
../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 4 (Thread 0x7fffdf465700 (LWP 10261)):
#0  __lll_lock_wait () at
../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:135
#1  0x00007ffff6f5b467 in _L_lock_913 () from
/lib/x86_64-linux-gnu/libpthread.so.0
#2  0x00007ffff6f5b290 in __GI___pthread_mutex_lock (mutex=0x7ffff5b5f370) at
../nptl/pthread_mutex_lock.c:79
#3  0x00007ffff595a00f in v4l2_ioctl () from
/usr/lib/x86_64-linux-gnu/libv4l2.so.0
#4  0x00007ffff6214900 in gst_v4l2_allocator_qbuf (allocator=0x7fffc80100e0,
group=0x7fffc801c470) at gstv4l2allocator.c:1235
#5  0x00007ffff621f191 in gst_v4l2_buffer_pool_qbuf
(pool=pool at entry=0x7fffc800e150, buf=buf at entry=0x867820) at
gstv4l2bufferpool.c:991
#6  0x00007ffff621fdbc in gst_v4l2_buffer_pool_release_buffer
(bpool=0x7fffc800e150, buffer=0x867820) at gstv4l2bufferpool.c:1235
#7  0x00007ffff7b0a683 in gst_buffer_pool_release_buffer (pool=0x7fffc800e150,
buffer=0x867820) at gstbufferpool.c:1284
#8  0x00007ffff7b04ba3 in _gst_buffer_dispose (buffer=0x867820) at
gstbuffer.c:541
#9  0x00007ffff7b31a8e in gst_mini_object_unref (mini_object=0x867820) at
gstminiobject.c:446
#10 0x00007ffff5b993c1 in gst_buffer_unref (buf=0x867820) at
../../../gst/gstbuffer.h:360
#11 gst_base_transform_handle_buffer (trans=trans at entry=0x84fc30,
inbuf=inbuf at entry=0x867820, outbuf=outbuf at entry=0x7fffdf464cb8)
    at gstbasetransform.c:2128
#12 0x00007ffff5b99a14 in gst_base_transform_chain (pad=<optimized out>,
parent=<optimized out>, buffer=0x867820) at gstbasetransform.c:2224
#13 0x00007ffff7b35ab5 in gst_pad_chain_data_unchecked (data=0x867820,
type=4112, pad=0x7ab480) at gstpad.c:3827
#14 gst_pad_push_data (pad=0x7ab250, type=type at entry=4112, data=<optimized
out>, data at entry=0x867820) at gstpad.c:4060
#15 0x00007ffff7b3cca6 in gst_pad_push (pad=<optimized out>,
buffer=buffer at entry=0x867820) at gstpad.c:4171
#16 0x00007ffff4bdb432 in gst_queue_push_one (queue=0x7c43d0) at
gstqueue.c:1118
#17 gst_queue_loop (pad=<optimized out>) at gstqueue.c:1247
#18 0x00007ffff7b64599 in gst_task_func (task=0x882050) at gsttask.c:317
#19 0x00007ffff73e089c in g_thread_pool_thread_proxy (data=<optimized out>) at
/tmp/buildd/glib2.0-2.40.0/./glib/gthreadpool.c:307
#20 0x00007ffff73dff15 in g_thread_proxy (data=0x8644f0) at
/tmp/buildd/glib2.0-2.40.0/./glib/gthread.c:764
#21 0x00007ffff6f59062 in start_thread (arg=0x7fffdf465700) at
pthread_create.c:312
#22 0x00007ffff6c8cc1d in clone () at
../sysdeps/unix/sysv/linux/x86_64/clone.S:111
---Type <return> to continue, or q <return> to quit---

Thread 3 (Thread 0x7fffdfc66700 (LWP 10260)):
#0  0x00007ffff6f6013d in nanosleep () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007ffff73e14a8 in g_usleep (microseconds=microseconds at entry=50000) at
/tmp/buildd/glib2.0-2.40.0/./glib/gtimer.c:259
#2  0x00007fffdfe73aff in gst_xvimagesink_event_thread (xvimagesink=0x864a10)
at xvimagesink.c:582
#3  0x00007ffff73dff15 in g_thread_proxy (data=0x864230) at
/tmp/buildd/glib2.0-2.40.0/./glib/gthread.c:764
#4  0x00007ffff6f59062 in start_thread (arg=0x7fffdfc66700) at
pthread_create.c:312
#5  0x00007ffff6c8cc1d in clone () at
../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 2 (Thread 0x7fffe0a83700 (LWP 10259)):
#0  0x00007ffff6c8190d in poll () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007fffe61fd798 in ?? () from /lib/x86_64-linux-gnu/libusb-1.0.so.0
#2  0x00007ffff6f59062 in start_thread (arg=0x7fffe0a83700) at
pthread_create.c:312
#3  0x00007ffff6c8cc1d in clone () at
../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 1 (Thread 0x7ffff7fcd700 (LWP 10226)):
#0  __lll_lock_wait () at
../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:135
#1  0x00007ffff6f5b49d in _L_lock_1086 () from
/lib/x86_64-linux-gnu/libpthread.so.0
#2  0x00007ffff6f5b417 in __GI___pthread_mutex_lock (mutex=0x7a61c0) at
../nptl/pthread_mutex_lock.c:134
#3  0x00007ffff73fc991 in g_mutex_lock (mutex=mutex at entry=0x7a84d0) at
/tmp/buildd/glib2.0-2.40.0/./glib/gthread-posix.c:209
#4  0x00007ffff5b8de4b in gst_base_src_set_playing
(basesrc=basesrc at entry=0x7a83c0, live_play=live_play at entry=0) at
gstbasesrc.c:3627
#5  0x00007ffff5b921ea in gst_base_src_change_state (element=<optimized out>,
transition=GST_STATE_CHANGE_PLAYING_TO_PAUSED) at gstbasesrc.c:3802
#6  0x00007ffff622548f in gst_v4l2src_change_state (element=0x7a83c0,
transition=GST_STATE_CHANGE_PLAYING_TO_PAUSED) at gstv4l2src.c:598
#7  0x00007ffff7b20872 in gst_element_change_state
(element=element at entry=0x7a83c0,
transition=transition at entry=GST_STATE_CHANGE_PLAYING_TO_PAUSED)
    at gstelement.c:2600
#8  0x00007ffff7b20f4c in gst_element_set_state_func (element=0x7a83c0,
state=GST_STATE_PAUSED) at gstelement.c:2556
#9  0x00007ffff7b03e86 in gst_bin_element_set_state (next=GST_STATE_PAUSED,
current=GST_STATE_PLAYING, start_time=5343189002, 
    base_time=15102045095951, element=0x7a83c0, bin=0x862040) at gstbin.c:2323
#10 gst_bin_change_state_func (element=0x862040,
transition=GST_STATE_CHANGE_PLAYING_TO_PAUSED) at gstbin.c:2660
#11 0x00007ffff7b40102 in gst_pipeline_change_state (element=0x862040,
transition=GST_STATE_CHANGE_PLAYING_TO_PAUSED) at gstpipeline.c:469
#12 0x00007ffff7b20872 in gst_element_change_state
(element=element at entry=0x862040,
transition=transition at entry=GST_STATE_CHANGE_PLAYING_TO_PAUSED)
    at gstelement.c:2600
#13 0x00007ffff7b20f4c in gst_element_set_state_func (element=0x862040,
state=GST_STATE_PAUSED) at gstelement.c:2556
#14 0x00000000004039d5 in main (argc=14, argv=0x7fffffffbcb8) at
gst-launch.c:1135

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list