v4l2codecs: vp9 logs GStreamer-CRITICAL **: 19:48:02.667: gst_mini_object_unref: assertion 'GST_MINI_OBJECT_REFCOUNT_VALUE (mini_object) > 0' failed
Describe your issue
When using the v4l2slvp9dec
plugin, an object gets freed too many time at the end of the processing.
It shows the message:
(gst-launch-1.0:242): GStreamer-CRITICAL **: 19:48:02.667: gst_mini_object_unref: assertion 'GST_MINI_OBJECT_REFCOUNT_VALUE (mini_object) > 0' failed
This has been spotted in the v4l2sl kvm tests: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/jobs/57237793
Expected Behavior
Cleanup should not free objects with no references
Observed Behavior
Setup
- Operating System: linux v6.5.8
- Device: Virtual Machine
-
GStreamer Version: main branch (latest test with commit
c308f013a76c17df85159ba7e91e46bba22bf22f
) -
Command line:
gst-launch-1.0 --no-fault filesrc location=/opt/fluster/fluster/../resources/VP9-TEST-VECTORS-HIGH/vp92-2-20-10bit-yuv420.webm/vp92-2-20-10bit-yuv420.webm ! parsebin ! v4l2slvp9dec ! video/x-raw ! videoconvert dither=none ! video/x-raw,format=I420_10LE ! videocodectestsink -m
Steps to reproduce the bug
(host) cd /path/to/gstreamer
# Run docker
(host) docker run -it -v $(pwd):$(pwd) --device /dev/kvm registry.freedesktop.org/gstreamer/gstreamer/amd64/fedora:2024-03-29.0-main
# Build gstreamer
(docker) cd /path/to/gstreamer
(docker) meson setup build/ --native-file ./ci/meson/gst-ci-cflags.ini --default-library=static -Dgstreamer:gst_debug=false -Dvirtme_kernel_image=/opt/linux/bzImage -Dauto_features=disabled -Dgstreamer:check=enabled -Ddoc=disabled -Dtests=enabled -Dtools=enabled -Dbase=enabled -Dbad=enabled -Dugly=disabled -Dlibav=disabled -Drtsp_server=disabled -Dges=disabled -Dgst-plugins-bad:debugutils=enabled -Dgst-plugins-bad:ivfparse=enabled -Dgst-plugins-bad:v4l2codecs=enabled -Dgst-plugins-bad:videoparsers=enabled -Dgst-plugins-base:app=enabled -Dgst-plugins-base:videoconvertscale=enabled -Dgst-plugins-base:typefind=enabled -Dgst-plugins-base:playback=enabled -Dgst-plugins-good:matroska=enabled --native-file ./ci/meson/gst-werror.ini
(docker) meson compile -C build/
# Run KVM (for the visl driver)
(docker) virtme-run --memory=2G --rw --pwd --kimg "/opt/linux/bzImage" --show-boot-console --qemu-opts -cpu host,pdcm=off -smp 8
G_DEBUG=fatal_warnings gdb gst-launch-1.0
# Go in the gst devenv
(kvm) meson devenv -C build
# Run with GDB
(kvm) G_DEBUG=fatal_warnings gdb gst-launch-1.0
(gdb) run --no-fault filesrc location=/opt/fluster/fluster/../resources/VP9-TEST-VECTORS-HIGH/vp92-2-20-10bit-yuv420.webm/vp92-2-20-10bit-yuv420.webm ! parsebin ! v4l2slvp9dec ! video/x-raw ! videoconvert dither=none ! video/x-raw,format=I420_10LE ! videocodectestsink -m
(gdb) bt
The backtrace looks like this:
(gdb) bt
#0 g_logv (log_domain=0x7ffff7ede8c0 "GStreamer", log_level=G_LOG_LEVEL_CRITICAL, format=<optimized out>, args=<optimized out>) at ../glib/gmessages.c:1413
#1 0x00007ffff7b50903 in g_log (log_domain=<optimized out>, log_level=<optimized out>, format=<optimized out>) at ../glib/gmessages.c:1451
#2 0x00007ffff7ad33d8 in g_value_unset (value=value@entry=0x7fffec01ee40) at ../gobject/gvalue.c:278
#3 0x00007ffff7d00136 in gst_structure_free (structure=0x7fffec01ee10) at ../subprojects/gstreamer/gst/gststructure.c:538
#4 0x00007ffff7cb9208 in gst_buffer_pool_finalize (object=0x51cc90 [GstVideoBufferPool]) at ../subprojects/gstreamer/gst/gstbufferpool.c:212
#5 0x00007ffff7ab8b18 in g_object_unref (_object=<optimized out>) at ../gobject/gobject.c:3524
#6 g_object_unref (_object=0x51cc90) at ../gobject/gobject.c:3416
#7 0x00007ffff7db4997 in gst_video_decoder_reset (decoder=decoder@entry=0x516250 [v4l2slvp9dec], full=full@entry=1, flush_hard=<optimized out>, flush_hard@entry=1) at ../subprojects/gst-plugins-base/gst-libs/gst/video/gstvideodecoder.c:2380
#8 0x00007ffff7db4d2f in gst_video_decoder_change_state (element=0x516250 [v4l2slvp9dec], transition=<optimized out>) at ../subprojects/gst-plugins-base/gst-libs/gst/video/gstvideodecoder.c:2869
#9 0x00007ffff7cce9e1 in gst_element_change_state (element=0x516250 [v4l2slvp9dec], transition=GST_STATE_CHANGE_PAUSED_TO_READY) at ../subprojects/gstreamer/gst/gstelement.c:3101
#10 0x00007ffff7cced22 in gst_element_set_state_func (element=0x516250 [v4l2slvp9dec], state=GST_STATE_READY) at ../subprojects/gstreamer/gst/gstelement.c:3055
#11 0x00007ffff7cb3b3e in gst_bin_element_set_state (next=GST_STATE_READY, current=GST_STATE_PAUSED, start_time=0, base_time=112915510373, element=0x516250 [v4l2slvp9dec], bin=0x51c070 [GstPipeline]) at ../subprojects/gstreamer/gst/gstbin.c:2582
#12 gst_bin_change_state_func (element=0x51c070 [GstPipeline], transition=GST_STATE_CHANGE_PAUSED_TO_READY) at ../subprojects/gstreamer/gst/gstbin.c:2934
#13 0x00007ffff7cec51d in gst_pipeline_change_state (element=0x51c070 [GstPipeline], transition=GST_STATE_CHANGE_PAUSED_TO_READY) at ../subprojects/gstreamer/gst/gstpipeline.c:534
#14 0x00007ffff7cce9e1 in gst_element_change_state (element=0x51c070 [GstPipeline], transition=GST_STATE_CHANGE_PAUSED_TO_READY) at ../subprojects/gstreamer/gst/gstelement.c:3101
#15 0x00007ffff7cced22 in gst_element_set_state_func (element=0x51c070 [GstPipeline], state=GST_STATE_NULL) at ../subprojects/gstreamer/gst/gstelement.c:3055
#16 0x0000000000404c9d in real_main (argc=<optimized out>, argv=<optimized out>) at ../subprojects/gstreamer/tools/gst-launch.c:1362
#17 0x00007ffff78cfb75 in __libc_start_main (main=0x4038c0 <main>, argc=18, argv=0x7fffffffe738, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffe728) at ../csu/libc-start.c:332
#18 0x00000000004038fe in _start ()
How reproducible is the bug?
Always with some specific vector files
Additional Information
This is using visl, the virtual v4l2 stateless driver, in a virtual machine