GNOME Bugzilla – Bug 695203
xvimagesink: crash in gst_xvimagesink_xvimage_put() with HLS bip-bop stream after a while
Last modified: 2013-03-14 13:47:53 UTC
GST_DEBUG=*hls*:5 gst-launch-1.0 playbin uri="https://devimages.apple.com.edgekey.net/resources/http-streaming/examples/bipbop_4x3/bipbop_4x3_variant.m3u8" -v (gdb) info threads Id Target Id Frame 23 Thread 0x7f40c2eb8700 (LWP 6125) "dconf worker" 0x00007f40c6e7cfad in poll () from /usr/lib/libc.so.6 22 Thread 0x7f40c26b7700 (LWP 6126) "source:src" 0x00007f40c7155954 in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0 21 Thread 0x7f40c1eb6700 (LWP 6127) "gmain" 0x00007f40c6e7cfad in poll () from /usr/lib/libc.so.6 20 Thread 0x7f40c0eb4700 (LWP 6129) "gdbus" 0x00007f40c6e7cfad in poll () from /usr/lib/libc.so.6 19 Thread 0x7f40aa802700 (LWP 6131) "queue2-0:src" 0x00007f40c7155954 in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0 18 Thread 0x7f40aa001700 (LWP 6132) "task2" 0x00007f40c7155954 in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0 17 Thread 0x7f40a9800700 (LWP 6133) "multiqueue0:src" 0x00007f40c7155954 in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0 16 Thread 0x7f40a8cc2700 (LWP 6137) "multiqueue1:src" 0x00007f40c7155954 in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0 15 Thread 0x7f4093fff700 (LWP 6138) "multiqueue1:src" 0x00007f40c7155954 in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0 14 Thread 0x7f408865e700 (LWP 6147) "xvimagesink-eve" 0x00007f40c715810c in __lll_lock_wait () from /usr/lib/libpthread.so.0 13 Thread 0x7f40875b4700 (LWP 6148) "vqueue:src" 0x00007f40c7158a9d in nanosleep () from /usr/lib/libpthread.so.0 12 Thread 0x7f40850c2700 (LWP 6152) "aqueue:src" 0x00007f40c7155954 in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0 11 Thread 0x7f407f2c5700 (LWP 6153) "audiosink-ringb" 0x00007f40c6e7cfad in poll () from /usr/lib/libc.so.6 10 Thread 0x7f407e2c3700 (LWP 6155) "task1" 0x00007f40c7155d01 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0 9 Thread 0x7f4089ffb700 (LWP 6156) "multiqueue1:src" 0x00007f40c7155954 in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0 8 Thread 0x7f408a7fc700 (LWP 6157) "multiqueue1:src" 0x00007f40c7155954 in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0 7 Thread 0x7f408affd700 (LWP 6158) "multiqueue1:src" 0x00007f40c7155954 in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0 6 Thread 0x7f408b7fe700 (LWP 6159) "multiqueue1:src" 0x00007f40c7155954 in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0 5 Thread 0x7f40ab42a700 (LWP 6160) "multiqueue1:src" 0x00007f40c7155954 in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0 4 Thread 0x7f4091ff9700 (LWP 6161) "multiqueue1:src" 0x00007f40c7155954 in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0 3 Thread 0x7f40917f8700 (LWP 6162) "multiqueue1:src" 0x00007f40c7155954 in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0 2 Thread 0x7f4090ff7700 (LWP 6163) "multiqueue1:src" 0x00007f40c7155954 in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0 * 1 Thread 0x7f40c7d84700 (LWP 6124) "gst-launch-1.0" 0x00007f40c6e7cfad in poll () from /usr/lib/libc.so.6 (gdb) Id Target Id Frame 23 Thread 0x7f40c2eb8700 (LWP 6125) "dconf worker" 0x00007f40c6e7cfad in poll () from /usr/lib/libc.so.6 22 Thread 0x7f40c26b7700 (LWP 6126) "source:src" 0x00007f40c7155954 in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0 21 Thread 0x7f40c1eb6700 (LWP 6127) "gmain" 0x00007f40c6e7cfad in poll () from /usr/lib/libc.so.6 20 Thread 0x7f40c0eb4700 (LWP 6129) "gdbus" 0x00007f40c6e7cfad in poll () from /usr/lib/libc.so.6 19 Thread 0x7f40aa802700 (LWP 6131) "queue2-0:src" 0x00007f40c7155954 in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0 18 Thread 0x7f40aa001700 (LWP 6132) "task2" 0x00007f40c7155954 in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0 17 Thread 0x7f40a9800700 (LWP 6133) "multiqueue0:src" 0x00007f40c7155954 in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0 16 Thread 0x7f40a8cc2700 (LWP 6137) "multiqueue1:src" 0x00007f40c7155954 in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0 15 Thread 0x7f4093fff700 (LWP 6138) "multiqueue1:src" 0x00007f40c7155954 in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0 14 Thread 0x7f408865e700 (LWP 6147) "xvimagesink-eve" 0x00007f40c715810c in __lll_lock_wait () from /usr/lib/libpthread.so.0 13 Thread 0x7f40875b4700 (LWP 6148) "vqueue:src" 0x00007f40c7158a9d in nanosleep () from /usr/lib/libpthread.so.0 12 Thread 0x7f40850c2700 (LWP 6152) "aqueue:src" 0x00007f40c7155954 in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0 11 Thread 0x7f407f2c5700 (LWP 6153) "audiosink-ringb" 0x00007f40c6e7cfad in poll () from /usr/lib/libc.so.6 10 Thread 0x7f407e2c3700 (LWP 6155) "task1" 0x00007f40c7155d01 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0 9 Thread 0x7f4089ffb700 (LWP 6156) "multiqueue1:src" 0x00007f40c7155954 in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0 8 Thread 0x7f408a7fc700 (LWP 6157) "multiqueue1:src" 0x00007f40c7155954 in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0 7 Thread 0x7f408affd700 (LWP 6158) "multiqueue1:src" 0x00007f40c7155954 in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0 6 Thread 0x7f408b7fe700 (LWP 6159) "multiqueue1:src" 0x00007f40c7155954 in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0 5 Thread 0x7f40ab42a700 (LWP 6160) "multiqueue1:src" 0x00007f40c7155954 in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0 4 Thread 0x7f4091ff9700 (LWP 6161) "multiqueue1:src" 0x00007f40c7155954 in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0 3 Thread 0x7f40917f8700 (LWP 6162) "multiqueue1:src" 0x00007f40c7155954 in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0 2 Thread 0x7f4090ff7700 (LWP 6163) "multiqueue1:src" 0x00007f40c7155954 in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0 * 1 Thread 0x7f40c7d84700 (LWP 6124) "gst-launch-1.0" 0x00007f40c6e7cfad in poll () from /usr/lib/libc.so.6 (gdb) thread apply all bt
+ Trace 231593
Thread 13 (Thread 0x7f40875b4700 (LWP 6148))
Thanks. Stack traces are usually more useful if debugging symbols for gstreamer and glib are available. Presumably/possibly a regression in the xvimage memory handling rewrite, so moving there for now.
This is my analysis: 1) a buffer is allocated from a pool and contains the memory with the xvimage 2) then the decoder needs to keep a ref to a frame 3) then the decoder wants to write to the buffer -> the buffer is copied 4) to make a buffer copy, a new empty buffer is allocated 5) then the memory is *shared* between the original and the copy 6) now there is a bufferpool buffer A pointing to the xvimage and another buffer B with the same xvimage backed memory, not a problem yet 7) then someone wants to write to buffer A, the buffer is writable but the memory isn't -> the memory is copied 8) then the memory in A is replaced with the copy <- problem because now A is supposed to be a bufferpool buffer but without xvimage memory anymore If at some point then A is used directly in the XvShmPutImage things crash.
commit 470f02d186dccc6cd823ae762c856b92e3ff2f93 Author: Wim Taymans <wim.taymans@collabora.co.uk> Date: Tue Mar 5 16:41:52 2013 +0100 ximagesink: don't share memory commit b740edff06813ed618b5e82080893df4e37ab20e Author: Wim Taymans <wim.taymans@collabora.co.uk> Date: Tue Mar 5 16:34:35 2013 +0100 xvimagesink: mark as NO_SHARE We don't want to share the memory between buffers because that could cause the memory of the bufferpool buffers to be copied and replaced with other memory. This is a hopefully a temporary fix until we can figure out how to share properly. Fixes https://bugzilla.gnome.org/show_bug.cgi?id=695203
Still lots of HLS-related issues: ** (gst-launch-1.0:31931): CRITICAL **: gst_fragment_get_buffer: assertion `fragment != NULL' failed (gst-launch-1.0:31931): GStreamer-CRITICAL **: gst_buffer_get_sizes_range: assertion `GST_IS_BUFFER (buffer)' failed (gst-launch-1.0:31931): GStreamer-CRITICAL **: gst_mini_object_unref: assertion `mini_object != NULL' failed Also lots of errors from avdec_h264.
commit 0cf392837d6660e05b54ea0b8682471359bf35d1 Author: Wim Taymans <wim.taymans@collabora.co.uk> Date: Wed Mar 13 11:13:58 2013 +0100 xvimagesink: use xvcontext for allocation Make a new refcounted xvcontext object that handles the X connection. Use the xvcontext to allocate images and windows. Move some code around so that all X calls are made from the xvcontext object. Make a GstXvImageAllocator object that allocates images from the xvcontext. We can implement a copy function now for these memory objects now. Make the bufferpool use the xvimageallocator object for its images.
(In reply to comment #4) > Still lots of HLS-related issues: > > ** (gst-launch-1.0:31931): CRITICAL **: gst_fragment_get_buffer: assertion > `fragment != NULL' failed > > (gst-launch-1.0:31931): GStreamer-CRITICAL **: gst_buffer_get_sizes_range: > assertion `GST_IS_BUFFER (buffer)' failed > > (gst-launch-1.0:31931): GStreamer-CRITICAL **: gst_mini_object_unref: assertion > `mini_object != NULL' failed > > Also lots of errors from avdec_h264. I think these are due to general hls brokenness, I think the original xvimagesink issue is fixed. Reassign to hlsdemux or close?
Let's close it and open a new bug for the general hls brokeness, since it doesn't look related. (Though I'm sure it worked fine/better a while back when I last tested it..)