[Bug 795303] New: encoder: h265: assertion when releasing internal codec buffers in certain pipelines (intel driver)

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Mon Apr 16 15:33:13 UTC 2018


https://bugzilla.gnome.org/show_bug.cgi?id=795303

            Bug ID: 795303
           Summary: encoder: h265: assertion when releasing internal codec
                    buffers in certain pipelines (intel driver)
    Classification: Platform
           Product: GStreamer
           Version: git master
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: Normal
         Component: gstreamer-vaapi
          Assignee: gstreamer-bugs at lists.freedesktop.org
          Reporter: vjaquez at igalia.com
        QA Contact: gstreamer-bugs at lists.freedesktop.org
                CC: bsreerenj at gmail.com, vjaquez at igalia.com
     GNOME version: ---

the simplest pipeline I've found to replicated the assertion is

gst-launch-1.0 -ve videotestsrc num-buffers=50 ! vaapih265enc ! \
   matroskamux ! matroskademux ! fakesink silent=false

backtrace:

#0  0x00007ffff6927e7b in __GI_raise (sig=sig at entry=0x6) at
../sysdeps/unix/sysv/linux/raise.c:51
#1  0x00007ffff6929231 in __GI_abort () at abort.c:79
#2  0x00007ffff69209da in __assert_fail_base (fmt=0x7ffff6a73d48 "%s%s%s:%u:
%s%sAssertion `%s' failed.\n%n", assertion=assertion at entry=0x7fffee608ea0
"atomic_read(&bo_gem->refcount) > 0", file=file at entry=0x7fffee6089b0
"../../intel/intel_bufmgr_gem.c", line=line at entry=0x585,
function=function at entry=0x7fffee609460 "drm_intel_gem_bo_unreference") at
assert.c:92
#3  0x00007ffff6920a52 in __GI___assert_fail (assertion=0x7fffee608ea0
"atomic_read(&bo_gem->refcount) > 0", file=0x7fffee6089b0
"../../intel/intel_bufmgr_gem.c", line=0x585, function=0x7fffee609460
"drm_intel_gem_bo_unreference") at assert.c:101
#4  0x00007fffee5f9cd3 in  () at /usr/lib/x86_64-linux-gnu/libdrm_intel.so.1
#5  0x00007fffee8ae359 in i965_destroy_surface_storage (obj_surface=0x88a400)
at i965_drv_video.c:1591
#6  0x00007fffee8af201 in i965_destroy_surface (heap=0x881370, obj=0x88a400) at
i965_drv_video.c:1605
#7  0x00007fffee8af1c8 in i965_DestroySurfaces (ctx=0x87f360,
surface_list=0x7fffe818a400, num_surfaces=0x1) at i965_drv_video.c:2110
#8  0x00007fffee953de8 in gen9_hevc_free_surface_private (data=0x889d50) at
gen9_hevc_encoder.c:273
#9  0x00007fffee8ae38c in i965_destroy_surface_storage (obj_surface=0x889cd0)
at i965_drv_video.c:1595
#10 0x00007fffee8af201 in i965_destroy_surface (heap=0x881370, obj=0x889cd0) at
i965_drv_video.c:1605
#11 0x00007fffee8af1c8 in i965_DestroySurfaces (ctx=0x87f360,
surface_list=0x7fffffff9aec, num_surfaces=0x1) at i965_drv_video.c:2110
#12 0x00007ffff24551bb in vaDestroySurfaces (dpy=0x87f1f0,
surface_list=0x7fffffff9aec, num_surfaces=0x1) at va.c:1163
#13 0x00007ffff4dd6a79 in gst_vaapi_surface_destroy (surface=0x84ed40) at
gstvaapisurface.c:85
#14 0x00007ffff4dd1f14 in gst_vaapi_object_finalize (object=0x84ed40) at
gstvaapiobject.c:50
#15 0x00007ffff4dd1aaf in gst_vaapi_mini_object_free (object=0x84ed40) at
gstvaapiminiobject.c:39
#16 0x00007ffff4dd237c in gst_vaapi_mini_object_unref_internal
(object=0x84ed40) at ./gstvaapiminiobject.h:202
#17 0x00007ffff4dd2115 in gst_vaapi_object_unref_internal (object=0x84ed40) at
./gstvaapiobject_priv.h:209
#18 0x00007ffff4dd20f5 in gst_vaapi_object_unref (object=0x84ed40) at
gstvaapiobject.c:130
#19 0x00007ffff73339bc in g_queue_foreach () at
/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#20 0x00007ffff4dddd28 in gst_vaapi_video_pool_finalize (pool=0x7fffe800d060)
at gstvaapivideopool.c:76
#21 0x00007ffff4dd1aaf in gst_vaapi_mini_object_free (object=0x7fffe800d060) at
gstvaapiminiobject.c:39
#22 0x00007ffff4dd1d8c in gst_vaapi_mini_object_unref_internal
(object=0x7fffe800d060) at ./gstvaapiminiobject.h:202
#23 0x00007ffff4dd1ea0 in gst_vaapi_mini_object_replace
(old_object_ptr=0x853708, new_object=0x0) at gstvaapiminiobject.c:173
#24 0x00007ffff4da65a4 in context_destroy_surfaces (context=0x8536a0) at
gstvaapicontext.c:89
#25 0x00007ffff4da6d2e in gst_vaapi_context_finalize (context=0x8536a0) at
gstvaapicontext.c:411
#26 0x00007ffff4dd1f14 in gst_vaapi_object_finalize (object=0x8536a0) at
gstvaapiobject.c:50
#27 0x00007ffff4dd1aaf in gst_vaapi_mini_object_free (object=0x8536a0) at
gstvaapiminiobject.c:39
#28 0x00007ffff4dd1d8c in gst_vaapi_mini_object_unref_internal
(object=0x8536a0) at ./gstvaapiminiobject.h:202
#29 0x00007ffff4dd1ea0 in gst_vaapi_mini_object_replace
(old_object_ptr=0x8635d0, new_object=0x0) at gstvaapiminiobject.c:173
#30 0x00007ffff4deed68 in gst_vaapi_object_replace_internal
(old_object_ptr=0x8635d0, new_object=0x0) at ./gstvaapiobject_priv.h:215
#31 0x00007ffff4deecf6 in coded_buffer_pool_finalize (pool=0x863580) at
gstvaapicodedbufferpool.c:58
#32 0x00007ffff4dd1aaf in gst_vaapi_mini_object_free (object=0x863580) at
gstvaapiminiobject.c:39
#33 0x00007ffff4dd1d8c in gst_vaapi_mini_object_unref_internal
(object=0x863580) at ./gstvaapiminiobject.h:202
#34 0x00007ffff4dd1ea0 in gst_vaapi_mini_object_replace
(old_object_ptr=0x8902d0, new_object=0x0) at gstvaapiminiobject.c:173
#35 0x00007ffff4ddde48 in gst_vaapi_video_pool_replace (old_pool_ptr=0x8902d0,
new_pool=0x0) at gstvaapivideopool.c:122
#36 0x00007ffff4df1f3b in gst_vaapi_encoder_finalize (encoder=0x890160) at
gstvaapiencoder.c:1450
#37 0x00007ffff4dd1aaf in gst_vaapi_mini_object_free (object=0x890160) at
gstvaapiminiobject.c:39
#38 0x00007ffff4dd1d8c in gst_vaapi_mini_object_unref_internal
(object=0x890160) at ./gstvaapiminiobject.h:202
#39 0x00007ffff4dd1ea0 in gst_vaapi_mini_object_replace
(old_object_ptr=0x85bbb0, new_object=0x0) at gstvaapiminiobject.c:173
#40 0x00007ffff4df04b8 in gst_vaapi_object_replace_internal
(old_object_ptr=0x85bbb0, new_object=0x0) at ./gstvaapiobject_priv.h:215
#41 0x00007ffff4df0488 in gst_vaapi_encoder_replace (old_encoder_ptr=0x85bbb0,
new_encoder=0x0) at gstvaapiencoder.c:409
#42 0x00007ffff4d9d75f in gst_vaapiencode_destroy (encode=0x85b6d0) at
gstvaapiencode.c:466
#43 0x00007ffff4d9c815 in gst_vaapiencode_stop (venc=0x85b6d0) at
gstvaapiencode.c:546
#44 0x00007ffff56228fb in gst_video_encoder_change_state (element=0x85b6d0,
transition=GST_STATE_CHANGE_PAUSED_TO_READY) at gstvideoencoder.c:1601
#45 0x00007ffff4d9c734 in gst_vaapiencode_change_state (element=0x85b6d0,
transition=GST_STATE_CHANGE_PAUSED_TO_READY) at gstvaapiencode.c:769
#46 0x00007ffff7ac09b3 in gst_element_change_state (element=0x85b6d0,
transition=GST_STATE_CHANGE_PAUSED_TO_READY) at gstelement.c:2952
#47 0x00007ffff7ac34de in gst_element_set_state_func (element=0x85b6d0,
state=GST_STATE_READY) at gstelement.c:2906
#48 0x00007ffff7abffa2 in gst_element_set_state (element=0x85b6d0,
state=GST_STATE_READY) at gstelement.c:2807
#49 0x00007ffff7a8931d in gst_bin_element_set_state (bin=0x86e110,
element=0x85b6d0, base_time=0x157049623ff67, start_time=0x0,
current=GST_STATE_PAUSED, next=GST_STATE_READY) at gstbin.c:2602
#50 0x00007ffff7a82c26 in gst_bin_change_state_func (element=0x86e110,
transition=GST_STATE_CHANGE_PAUSED_TO_READY) at gstbin.c:2944
#51 0x00007ffff7b012c6 in gst_pipeline_change_state (element=0x86e110,
transition=GST_STATE_CHANGE_PAUSED_TO_READY) at gstpipeline.c:508
#52 0x00007ffff7ac09b3 in gst_element_change_state (element=0x86e110,
transition=GST_STATE_CHANGE_PAUSED_TO_READY) at gstelement.c:2952
#53 0x00007ffff7ac34de in gst_element_set_state_func (element=0x86e110,
state=GST_STATE_READY) at gstelement.c:2906
#54 0x00007ffff7abffa2 in gst_element_set_state (element=0x86e110,
state=GST_STATE_READY) at gstelement.c:2807
#55 0x0000000000404ae2 in main (argc=0xc, argv=0x7fffffffb308) at
gst-launch.c:1246


This issue might be a driver's issue.

It looks like a race condition when the driver releases internal HEVC surfaces
before the codec buffer is freed by the encoder.

-- 
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