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 695203 - xvimagesink: crash in gst_xvimagesink_xvimage_put() with HLS bip-bop stream after a while
xvimagesink: crash in gst_xvimagesink_xvimage_put() with HLS bip-bop stream a...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal blocker
: 1.1.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-03-05 11:38 UTC by Andreas Frisch
Modified: 2013-03-14 13:47 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Andreas Frisch 2013-03-05 11:38:37 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

Thread 13 (Thread 0x7f40875b4700 (LWP 6148))

  • #0 nanosleep
    from /usr/lib/libpthread.so.0
  • #1 g_usleep
    from /usr/lib/libglib-2.0.so.0
  • #2 ??
  • #3 <signal handler called>
  • #4 XvShmPutImage
    from /usr/lib/libXv.so.1
  • #5 ??
    from /usr/lib/gstreamer-1.0/libgstxvimagesink.so
  • #6 ??
    from /usr/lib/gstreamer-1.0/libgstxvimagesink.so
  • #7 ??
    from /usr/lib/libgstbase-1.0.so.0
  • #8 ??
    from /usr/lib/libgstbase-1.0.so.0
  • #9 ??
    from /usr/lib/libgstreamer-1.0.so.0
  • #10 gst_proxy_pad_chain_default
    from /usr/lib/libgstreamer-1.0.so.0
  • #11 ??
    from /usr/lib/libgstreamer-1.0.so.0
  • #12 gst_proxy_pad_chain_default
    from /usr/lib/libgstreamer-1.0.so.0
  • #13 ??
    from /usr/lib/libgstreamer-1.0.so.0
  • #14 ??
    from /usr/lib/libgstbase-1.0.so.0
  • #15 ??
    from /usr/lib/libgstreamer-1.0.so.0
  • #16 ??
    from /usr/lib/libgstbase-1.0.so.0
  • #17 ??
    from /usr/lib/libgstreamer-1.0.so.0
  • #18 ??
    from /usr/lib/libgstbase-1.0.so.0
  • #19 ??
    from /usr/lib/libgstreamer-1.0.so.0
  • #20 ??
    from /usr/lib/libgstbase-1.0.so.0
  • #21 ??
    from /usr/lib/libgstreamer-1.0.so.0
  • #22 gst_proxy_pad_chain_default
    from /usr/lib/libgstreamer-1.0.so.0
  • #23 ??
    from /usr/lib/libgstreamer-1.0.so.0
  • #24 ??
    from /usr/lib/gstreamer-1.0/libgstcoreelements.so
  • #25 ??
    from /usr/lib/libgstreamer-1.0.so.0
  • #26 ??
    from /usr/lib/libglib-2.0.so.0
  • #27 ??
    from /usr/lib/libglib-2.0.so.0
  • #28 start_thread
    from /usr/lib/libpthread.so.0
  • #29 clone
    from /usr/lib/libc.so.6

Comment 1 Tim-Philipp Müller 2013-03-05 11:58:35 UTC
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.
Comment 2 Wim Taymans 2013-03-05 14:21:34 UTC
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.
Comment 3 Wim Taymans 2013-03-05 15:42:38 UTC
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
Comment 4 Tim-Philipp Müller 2013-03-14 13:29:18 UTC
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.
Comment 5 Wim Taymans 2013-03-14 13:35:48 UTC
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.
Comment 6 Wim Taymans 2013-03-14 13:36:54 UTC
(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?
Comment 7 Tim-Philipp Müller 2013-03-14 13:40:06 UTC
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..)