Db410c 20.02 release gstreamer camera pipeline segmentation fault

Hi there,

I’m getting a sporadic crash on the 20.02 release when using the camera pipeline with Wayland/EGL.
This is when using MESA 19.1.6 - and when using a gstreamer GL filter plugin in the pipeline.

I can reproduce this crash with the following pipeline, and the crash occurs within minutes.

gst-launch-1.0 -v v4l2src device=/dev/v4l/by-path/platform-1b0ac00.camss-video-index3 ! video/x-raw,width=1280,height=720,format=NV12 ! queue ! glupload ! glcolorconvert ! glcolorscale ! ‘video/x-raw(memory:GLMemory),width=400,height=400,format=RGBA’ ! gltransformation scale-x=2.0 ! gleffects_blur ! gltransformation ! glimagesink

When reverting to MESA 18.1.9, this problem goes away.

backtrace here and attached:

Got context from element ‘sink’: gst.gl.GLDisplay=context, gst.gl.GLDisplay=(GstGLDisplay)"(GstGLDisplayWayland)\ gldisplaywayland0";
Setting pipeline to PLAYING …
New clock: GstSystemClock
/GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = video/x-raw, width=(int)1280, height=(int)720, format=(string)NV12, framerate=(fraction)120/1, colorimetry=(string)1:4:7:1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-raw, width=(int)1280, height=(int)720, format=(string)NV12, framerate=(fraction)120/1, colorimetry=(string)1:4:7:1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstQueue:queue0.GstPad:sink: caps = video/x-raw, width=(int)1280, height=(int)720, format=(string)NV12, framerate=(fraction)120/1, colorimetry=(string)1:4:7:1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = video/x-raw, width=(int)1280, height=(int)720, format=(string)NV12, framerate=(fraction)120/1, colorimetry=(string)1:4:7:1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstQueue:queue0.GstPad:src: caps = video/x-raw, width=(int)1280, height=(int)720, format=(string)NV12, framerate=(fraction)120/1, colorimetry=(string)1:4:7:1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstGLUploadElement:gluploadelement0.GstPad:src: caps = video/x-raw(memory:GLMemory), width=(int)1280, height=(int)720, format=(string)RGBA, framerate=(fraction)120/1, interlace-mode=(string)progressive, texture-target=(string)2D
/GstPipeline:pipeline0/GstGLColorConvertElement:glcolorconvertelement0.GstPad:src: caps = video/x-raw(memory:GLMemory), width=(int)1280, height=(int)720, format=(string)RGBA, framerate=(fraction)120/1, interlace-mode=(string)progressive, texture-target=(string)2D
/GstPipeline:pipeline0/GstGLColorscale:glcolorscale0.GstPad:src: caps = video/x-raw(memory:GLMemory), width=(int)400, height=(int)400, format=(string)RGBA, framerate=(fraction)120/1, interlace-mode=(string)progressive, texture-target=(string)2D
/GstPipeline:pipeline0/GstCapsFilter:capsfilter1.GstPad:src: caps = video/x-raw(memory:GLMemory), width=(int)400, height=(int)400, format=(string)RGBA, framerate=(fraction)120/1, interlace-mode=(string)progressive, texture-target=(string)2D
/GstPipeline:pipeline0/GstGLTransformation:gltransformation0.GstPad:src: caps = video/x-raw(memory:GLMemory), width=(int)400, height=(int)400, format=(string)RGBA, framerate=(fraction)120/1, interlace-mode=(string)progressive, texture-target=(string)2D
/GstPipeline:pipeline0/gleffects_blur:gleffects_blur0.GstPad:src: caps = video/x-raw(memory:GLMemory), width=(int)400, height=(int)400, format=(string)RGBA, framerate=(fraction)120/1, interlace-mode=(string)progressive, texture-target=(string)2D
/GstPipeline:pipeline0/GstGLTransformation:gltransformation1.GstPad:src: caps = video/x-raw(memory:GLMemory), width=(int)400, height=(int)400, format=(string)RGBA, framerate=(fraction)120/1, interlace-mode=(string)progressive, texture-target=(string)2D
/GstPipeline:pipeline0/GstGLImageSinkBin:glimagesinkbin0.GstGhostPad:sink.GstProxyPad:proxypad0: caps = video/x-raw(memory:GLMemory), width=(int)400, height=(int)400, format=(string)RGBA, framerate=(fraction)120/1, interlace-mode=(string)progressive, texture-target=(string)2D
/GstPipeline:pipeline0/GstGLImageSinkBin:glimagesinkbin0/GstGLUploadElement:gluploadelement1.GstPad:src: caps = video/x-raw(memory:GLMemory), width=(int)400, height=(int)400, format=(string)RGBA, framerate=(fraction)120/1, interlace-mode=(string)progressive, texture-target=(string)2D
/GstPipeline:pipeline0/GstGLImageSinkBin:glimagesinkbin0/GstGLColorConvertElement:glcolorconvertelement1.GstPad:src: caps = video/x-raw(memory:GLMemory), width=(int)400, height=(int)400, format=(string)RGBA, framerate=(fraction)120/1, interlace-mode=(string)progressive, texture-target=(string)2D
/GstPipeline:pipeline0/GstGLImageSinkBin:glimagesinkbin0/GstGLColorBalance:glcolorbalance0.GstPad:src: caps = video/x-raw(memory:GLMemory), width=(int)400, height=(int)400, format=(string)RGBA, framerate=(fraction)120/1, interlace-mode=(string)progressive, texture-target=(string)2D
/GstPipeline:pipeline0/GstGLImageSinkBin:glimagesinkbin0/GstGLImageSink:sink.GstPad:sink: caps = video/x-raw(memory:GLMemory), width=(int)400, height=(int)400, format=(string)RGBA, framerate=(fraction)120/1, interlace-mode=(string)progressive, texture-target=(string)2D
/GstPipeline:pipeline0/GstGLImageSinkBin:glimagesinkbin0/GstGLColorBalance:glcolorbalance0.GstPad:sink: caps = video/x-raw(memory:GLMemory), width=(int)400, height=(int)400, format=(string)RGBA, framerate=(fraction)120/1, interlace-mode=(string)progressive, texture-target=(string)2D
/GstPipeline:pipeline0/GstGLImageSinkBin:glimagesinkbin0/GstGLColorConvertElement:glcolorconvertelement1.GstPad:sink: caps = video/x-raw(memory:GLMemory), width=(int)400, height=(int)400, format=(string)RGBA, framerate=(fraction)120/1, interlace-mode=(string)progressive, texture-target=(string)2D
/GstPipeline:pipeline0/GstGLImageSinkBin:glimagesinkbin0/GstGLUploadElement:gluploadelement1.GstPad:sink: caps = video/x-raw(memory:GLMemory), width=(int)400, height=(int)400, format=(string)RGBA, framerate=(fraction)120/1, interlace-mode=(string)progressive, texture-target=(string)2D
/GstPipeline:pipeline0/GstGLImageSinkBin:glimagesinkbin0.GstGhostPad:sink: caps = video/x-raw(memory:GLMemory), width=(int)400, height=(int)400, format=(string)RGBA, framerate=(fraction)120/1, interlace-mode=(string)progressive, texture-target=(string)2D
/GstPipeline:pipeline0/GstGLTransformation:gltransformation1.GstPad:sink: caps = video/x-raw(memory:GLMemory), width=(int)400, height=(int)400, format=(string)RGBA, framerate=(fraction)120/1, interlace-mode=(string)progressive, texture-target=(string)2D
/GstPipeline:pipeline0/gleffects_blur:gleffects_blur0.GstPad:sink: caps = video/x-raw(memory:GLMemory), width=(int)400, height=(int)400, format=(string)RGBA, framerate=(fraction)120/1, interlace-mode=(string)progressive, texture-target=(string)2D
/GstPipeline:pipeline0/GstGLTransformation:gltransformation0.GstPad:sink: caps = video/x-raw(memory:GLMemory), width=(int)400, height=(int)400, format=(string)RGBA, framerate=(fraction)120/1, interlace-mode=(string)progressive, texture-target=(string)2D
/GstPipeline:pipeline0/GstCapsFilter:capsfilter1.GstPad:sink: caps = video/x-raw(memory:GLMemory), width=(int)400, height=(int)400, format=(string)RGBA, framerate=(fraction)120/1, interlace-mode=(string)progressive, texture-target=(string)2D
/GstPipeline:pipeline0/GstGLColorscale:glcolorscale0.GstPad:sink: caps = video/x-raw(memory:GLMemory), width=(int)1280, height=(int)720, format=(string)RGBA, framerate=(fraction)120/1, interlace-mode=(string)progressive, texture-target=(string)2D
/GstPipeline:pipeline0/GstGLColorConvertElement:glcolorconvertelement0.GstPad:sink: caps = video/x-raw(memory:GLMemory), width=(int)1280, height=(int)720, format=(string)RGBA, framerate=(fraction)120/1, interlace-mode=(string)progressive, texture-target=(string)2D
/GstPipeline:pipeline0/GstGLUploadElement:gluploadelement0.GstPad:sink: caps = video/x-raw, width=(int)1280, height=(int)720, format=(string)NV12, framerate=(fraction)120/1, colorimetry=(string)1:4:7:1, interlace-mode=(string)progressive

** (gst-launch-1.0:22562): CRITICAL **: 10:23:36.003: gst_gl_memory_setup_buffer: assertion ‘!wrapped_data || n_mem * views == n_wrapped_pointers’ failed
/GstPipeline:pipeline0/GstGLUploadElement:gluploadelement0.GstPad:src: caps = video/x-raw(memory:GLMemory), width=(int)1280, height=(int)720, format=(string)NV12, framerate=(fraction)120/1, colorimetry=(string)1:4:7:1, interlace-mode=(string)progressive, texture-target=(string)2D
/GstPipeline:pipeline0/GstGLColorConvertElement:glcolorconvertelement0.GstPad:sink: caps = video/x-raw(memory:GLMemory), width=(int)1280, height=(int)720, format=(string)NV12, framerate=(fraction)120/1, colorimetry=(string)1:4:7:1, interlace-mode=(string)progressive, texture-target=(string)2D
/GstPipeline:pipeline0/GstGLUploadElement:gluploadelement0.GstPad:sink: caps = video/x-raw, width=(int)1280, height=(int)720, format=(string)NV12, framerate=(fraction)120/1, colorimetry=(string)1:4:7:1, interlace-mode=(string)progressive
[New Thread 0xffffe6ffd1e0 (LWP 22605)]
[New Thread 0xffffe67fc1e0 (LWP 22606)]
[Thread 0xffffe67fc1e0 (LWP 22606) exited]
free(): corrupted unsorted chunks

Thread 3 “gstglcontext” received signal SIGABRT, Aborted.
[Switching to Thread 0xfffff67501e0 (LWP 34672)]
__GI_raise (sig=sig@entry=6) at …/sysdeps/unix/sysv/linux/raise.c:50
50 …/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0 __GI_raise (sig=sig@entry=6) at …/sysdeps/unix/sysv/linux/raise.c:50
#1 0x0000fffff7b61f54 in __GI_abort () at abort.c:79
#2 0x0000fffff7bac274 in __libc_message (action=action@entry=do_abort, fmt=fmt@entry=0xfffff7c64aa0 “%s\n”) at …/sysdeps/posix/libc_fatal.c:181
#3 0x0000fffff7bb352c in malloc_printerr (str=str@entry=0xfffff7c605b0 “free(): corrupted unsorted chunks”) at malloc.c:5332
#4 0x0000fffff7bb5160 in _int_free (av=0xffffe8000020, p=0xffffe873b740, have_lock=) at malloc.c:4356
#5 0x0000fffff502cbd4 in mesa_reference_renderbuffer (ptr=ptr@entry=0xffffe81502a8, rb=rb@entry=0x0) at …/mesa-19.1.6/src/mesa/main/renderbuffer.c:212
#6 0x0000fffff501b770 in _mesa_reference_renderbuffer (rb=0x0, ptr=0xffffe81502a8) at …/mesa-19.1.6/src/mesa/main/renderbuffer.h:72
#7 remove_attachment (ctx=ctx@entry=0xffffe81114f0, att=att@entry=0xffffe81502a0) at …/mesa-19.1.6/src/mesa/main/fbobject.c:405
#8 0x0000fffff5020b04 in set_texture_attachment (layered=0 ‘\000’, layer=0, samples=0, level=0, texTarget=3553, texObj=0xffffe8175380, att=0xffffe81502a0, fb=0xffffe8150000, ctx=0xffffe81114f0)
at …/mesa-19.1.6/src/mesa/main/fbobject.c:514
#9 _mesa_framebuffer_texture (ctx=0xffffe81114f0, fb=0xffffe8150000, attachment=36064, att=0xffffe81502a0, texObj=0xffffe8175380, textarget=3553, level=0, samples=0, layer=0, layered=0 ‘\000’)
at …/mesa-19.1.6/src/mesa/main/fbobject.c:3548
#10 0x0000fffff5020f40 in framebuffer_texture_with_dims (dims=dims@entry=2, target=, attachment=36064, textarget=3553, texture=, level=0, samples=samples@entry=0, layer=layer@entry=0,
caller=caller@entry=0xfffff54b0f30 “glFramebufferTexture2D”) at …/mesa-19.1.6/src/mesa/main/fbobject.c:3646
#11 0x0000fffff5021248 in _mesa_FramebufferTexture2D (target=, attachment=, textarget=, texture=, level=)
at …/mesa-19.1.6/src/mesa/main/fbobject.c:3684
#12 0x0000fffff721a53c in _attach_gl_memory (mem=0xffffe8175190, attachment_point=36064, fb=0x6af660 [GstGLFramebuffer|glframebuffer0]) at …/…/…/…/gst-plugins-base-1.16.1/gst-libs/gst/gl/gstglframebuffer.c:414
#13 gst_gl_framebuffer_attach (fb=fb@entry=0x6af660 [GstGLFramebuffer|glframebuffer0], attachment_point=attachment_point@entry=36064, mem=mem@entry=0xffffe8175190)
at …/…/…/…/gst-plugins-base-1.16.1/gst-libs/gst/gl/gstglframebuffer.c:471
#14 0x0000fffff721a7e4 in gst_gl_framebuffer_draw_to_texture (fb=0x6af660 [GstGLFramebuffer|glframebuffer0], mem=0xffffe8175190, func=func@entry=0xfffff7204760 <_glcb>, user_data=user_data@entry=0xfffff674f1b0)
at …/…/…/…/gst-plugins-base-1.16.1/gst-libs/gst/gl/gstglframebuffer.c:286
#15 0x0000fffff7206cf4 in gst_gl_filter_render_to_target (filter=filter@entry=0x671700 [GstGLFilter|gleffects_blur0], input=, output=, func=func@entry=0xfffff7206f10 <_draw_with_shader_cb>,
data=data@entry=0x0) at …/…/…/…/gst-plugins-base-1.16.1/gst-libs/gst/gl/gstglfilter.c:1079
#16 0x0000fffff7206d24 in gst_gl_filter_render_to_target_with_shader (filter=filter@entry=0x671700 [GstGLFilter|gleffects_blur0], input=, output=,
shader=shader@entry=0xffffdc028e10 [GstGLShader|glshader2]) at …/…/…/…/gst-plugins-base-1.16.1/gst-libs/gst/gl/gstglfilter.c:1160
#17 0x0000fffff738d8b8 in gst_gl_effects_blur (effects=0x671700 [GstGLEffects|gleffects_blur0]) at …/…/…/gst-plugins-base-1.16.1/ext/gl/effects/gstgleffectblur.c:56
#18 0x0000fffff738bb58 in gst_gl_effects_filter_texture (filter=, in_tex=, out_tex=) at …/…/…/gst-plugins-base-1.16.1/ext/gl/gstgleffects.c:543
#19 0x0000fffff7206c24 in gst_gl_filter_filter_texture (filter=0x671700 [GstGLFilter|gleffects_blur0], inbuf=, outbuf=) at …/…/…/…/gst-plugins-base-1.16.1/gst-libs/gst/gl/gstglfilter.c:978
#20 0x0000fffff7206cb0 in _filter_gl (context=, filter=0x671700 [GstGLFilter|gleffects_blur0]) at …/…/…/…/gst-plugins-base-1.16.1/gst-libs/gst/gl/gstglfilter.c:1001
#21 _filter_gl (context=, filter=0x671700 [GstGLFilter|gleffects_blur0]) at …/…/…/…/gst-plugins-base-1.16.1/gst-libs/gst/gl/gstglfilter.c:990
#22 0x0000fffff72162d0 in _run_message_sync (message=0xfffff4c52c80) at …/…/…/…/gst-plugins-base-1.16.1/gst-libs/gst/gl/gstglwindow.c:573
#23 0x0000fffff7216250 in _run_message_async (message=0x694360) at …/…/…/…/gst-plugins-base-1.16.1/gst-libs/gst/gl/gstglwindow.c:640
#24 0x0000fffff7d25834 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#25 0x0000fffff7d25bd0 in ?? () from /usr/lib/libglib-2.0.so.0
#26 0x0000fffff7d25f88 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
#27 0x0000fffff7216340 in gst_gl_window_default_run (window=0x69c0f0 [GstGLWindow|glwindowwaylandegl0]) at …/…/…/…/gst-plugins-base-1.16.1/gst-libs/gst/gl/gstglwindow.c:499
#28 0x0000fffff71fb910 in gst_gl_context_create_thread (context=0x6ad070 [GstGLContext|glcontextegl0]) at …/…/…/…/gst-plugins-base-1.16.1/gst-libs/gst/gl/gstglcontext.c:1305

Do you reproduce it with videotestsrc ?

gst-launch-1.0 -v videotestsrc !...

On my side with debian release 20.02, Mesa 19.1.8, it is not reproducible.

Yes, I believe I reproduced the issue with videotestsrc (with the same 1280x720 NV12 caps). I will double check though.

I have only seen the issue with egl/wayland.

Are you using the rpb-wayland 20.02 release?

Ok I’ve just tested with X11 for now.