crash OpenGL rendering to multiple X11 Window in multiple threads
@ystreet
Submitted by Matthew Waters Assigned to Ian Romanick
Description
Running the following command with the upcoming GStreamer 1.6 release crashes in a number of ways somewhere in the intel specific driver code in Mesa after at most a minute (generally less).
GST_GL_XINITTHREADS=1 gst-launch-1.0 videotestsrc ! glimagesink videotestsrc ! glimagesink (Adding more videotestsrc ! glimagesink combinations makes it crash faster)
GST_GL_PLATFORM=egl also crashes in somewhat similar ways
Versions: Linux 4.1.4 libdrm 2.4.64 Mesa 10.6.5 or master as of today GStreamer > 1.5.90
Backtrace 1 with GST_GL_PLATFORM=glx
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffbbfff700 (LWP 13783)]
gen7_update_renderbuffer_surface (brw=0x7fffb400e508, rb=0x7fffa00e2290, layered=<optimized out>, unit=<optimized out>, surf_index=<optimized out>)
at gen7_wm_surface_state.c:469
469 int min_array_element = irb->mt_layer / MAX2(mt->num_samples, 1);
(gdb) bt
#0 gen7_update_renderbuffer_surface (brw=0x7fffb400e508, rb=0x7fffa00e2290, layered=<optimized out>, unit=<optimized out>, surf_index=<optimized out>)
at gen7_wm_surface_state.c:469
#1 0x00007fffee929389 in brw_update_renderbuffer_surfaces (brw=0x7fffb400e508, fb=0x7fffb40eb750, render_target_start=0, surf_offset=0x7fffb403346c)
at brw_wm_surface_state.c:749
#2 0x00007fffee929401 in update_renderbuffer_surfaces (brw=0x7fffb400e508) at brw_wm_surface_state.c:773
#3 0x00007fffee907439 in check_and_emit_atom (atom=0x7fffb4033b58, state=<synthetic pointer>, brw=0x7fffb400e508) at brw_state_upload.c:650
#4 brw_upload_pipeline_state (pipeline=BRW_RENDER_PIPELINE, brw=0x7fffb400e508) at brw_state_upload.c:750
#5 brw_upload_render_state (brw=0x7fffb400e508) at brw_state_upload.c:772
#6 0x00007fffee892b54 in brw_try_draw_prims (indirect=<optimized out>, max_index=<optimized out>, min_index=<optimized out>, ib=0x0, nr_prims=<optimized out>,
prims=0x7fffbbffea70, arrays=<optimized out>, ctx=0x7fffb400e508) at brw_draw.c:517
#7 brw_draw_prims (ctx=ctx@entry=0x7fffb400e508, prims=prims@entry=0x7fffbbffeaf0, nr_prims=nr_prims@entry=1, ib=ib@entry=0x0,
index_bounds_valid=index_bounds_valid@entry=1 '\001', min_index=min_index@entry=0, max_index=2, unused_tfb_object=0x0, indirect=0x0) at brw_draw.c:605
#8 0x00007fffee8f3463 in brw_draw_rectlist (ctx=ctx@entry=0x7fffb400e508, rect=rect@entry=0x7fffbbffeb40, num_instances=num_instances@entry=1)
at brw_meta_fast_clear.c:201
#9 0x00007fffee8f3e3f in brw_meta_resolve_color (brw=0x7fffb400e508, mt=0x7fffb40e5ee0) at brw_meta_fast_clear.c:697
#10 0x00007fffee94aa55 in intel_miptree_resolve_color (brw=brw@entry=0x7fffb400e508, mt=<optimized out>) at intel_mipmap_tree.c:1912
#11 0x00007fffee889fdb in intel_resolve_for_dri2_flush (brw=brw@entry=0x7fffb400e508, drawable=drawable@entry=0x7fffb400db00) at brw_context.c:1147
#12 0x00007fffee88bf4e in intel_resolve_for_dri2_flush (brw=brw@entry=0x7fffb400e508, drawable=drawable@entry=0x7fffb400db00) at brw_context.c:1124
#13 0x00007fffee9512ab in intel_dri2_flush_with_flags (cPriv=<optimized out>, dPriv=0x7fffb400db00, flags=<optimized out>, reason=__DRI2_THROTTLE_SWAPBUFFER)
at intel_screen.c:176
#14 0x00007ffff4718988 in dri2SwapBuffers (pdraw=0x7fffb400da20, target_msc=0, divisor=0, remainder=0, flush=1) at dri2_glx.c:851
#15 0x00007ffff5686200 in gst_gl_context_glx_swap_buffers (context=<optimized out>) at gstglcontext_glx.c:411
#16 0x00007ffff56852da in gst_gl_window_x11_draw_unlocked (window=0x910cd0) at gstglwindow_x11.c:407
#17 0x00007ffff5685335 in draw_cb (data=0x910cd0) at gstglwindow_x11.c:443
#18 0x00007ffff567aa38 in _run_message_sync (message=0x7fff81ffa820) at gstglwindow.c:638
#19 0x00007ffff567a9d2 in _run_message_async (message=0x91a2a0) at gstglwindow.c:707
#20 0x00007ffff7077c4a in g_main_dispatch (context=0x917100) at gmain.c:3122
#21 g_main_context_dispatch (context=context@entry=0x917100) at gmain.c:3737
#22 0x00007ffff7077fc8 in g_main_context_iterate (context=0x917100, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3808
#23 0x00007ffff70782e2 in g_main_loop_run (loop=0x917240) at gmain.c:4002
#24 0x00007ffff56658e5 in gst_gl_context_create_thread (context=0x90b7f0) at gstglcontext.c:1369
#25 0x00007ffff709e675 in g_thread_proxy (data=0x6280f0) at gthread.c:764
#26 0x00007ffff6a0d4a4 in start_thread () from /usr/lib/libpthread.so.0
#27 0x00007ffff674b12d in clone () from /usr/lib/libc.so.6
Backtrace 2 with GST_GL_PLATFORM=egl
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffdde5f700 (LWP 14026)]
0x00007fffeec55a84 in check_begin_texture_render (fb=0x7fffb82085b0, ctx=0x7fffec1e1038) at main/fbobject.c:2229
2229 if (att->Texture && att->Renderbuffer->TexImage
(gdb) bt
#0 0x00007fffeec55a84 in check_begin_texture_render (fb=0x7fffb82085b0, ctx=0x7fffec1e1038) at main/fbobject.c:2229
#1 bind_framebuffer (target=36009, framebuffer=<optimized out>, allow_user_names=<optimized out>) at main/fbobject.c:2362
#2 0x00007fffeec58b8e in _mesa_BindFramebuffer (target=<optimized out>, framebuffer=<optimized out>) at main/fbobject.c:2380
#3 0x00007fffeef58d33 in brw_meta_resolve_color (brw=0x7fffec1e1038, mt=0x7fffd4208e20) at brw_meta_fast_clear.c:680
#4 0x00007fffeefafa55 in intel_miptree_resolve_color (brw=brw@entry=0x7fffec1e1038, mt=<optimized out>) at intel_mipmap_tree.c:1912
#5 0x00007fffeeeeefdb in intel_resolve_for_dri2_flush (brw=brw@entry=0x7fffec1e1038, drawable=drawable@entry=0x7fffd4048e80) at brw_context.c:1147
#6 0x00007fffeeef0f4e in intel_resolve_for_dri2_flush (brw=brw@entry=0x7fffec1e1038, drawable=drawable@entry=0x7fffd4048e80) at brw_context.c:1124
#7 0x00007fffeefb62ab in intel_dri2_flush_with_flags (cPriv=<optimized out>, dPriv=0x7fffd4048e80, flags=<optimized out>, reason=__DRI2_THROTTLE_SWAPBUFFER)
at intel_screen.c:176
#8 0x00007ffff39651a8 in dri2_x11_swap_buffers_msc (msc=0, divisor=0, remainder=0, drv=<optimized out>, draw=0x7fffd4048c00, disp=<optimized out>)
at platform_x11.c:795
#9 dri2_x11_swap_buffers (drv=<optimized out>, disp=<optimized out>, draw=0x7fffd4048c00) at platform_x11.c:831
#10 0x00007ffff395b866 in eglSwapBuffers (dpy=0x7fffe000da00, surface=<optimized out>) at eglapi.c:915
#11 0x00007ffff56852da in gst_gl_window_x11_draw_unlocked (window=0x910670) at gstglwindow_x11.c:407
#12 0x00007ffff5685335 in draw_cb (data=0x910670) at gstglwindow_x11.c:443
#13 0x00007ffff567aa38 in _run_message_sync (message=0x7fff949f1820) at gstglwindow.c:638
#14 0x00007ffff567a9d2 in _run_message_async (message=0x7fff60009840) at gstglwindow.c:707
#15 0x00007ffff7077c4a in g_main_dispatch (context=0x90f2b0) at gmain.c:3122
#16 g_main_context_dispatch (context=context@entry=0x90f2b0) at gmain.c:3737
#17 0x00007ffff7077fc8 in g_main_context_iterate (context=0x90f2b0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3808
#18 0x00007ffff70782e2 in g_main_loop_run (loop=0x90fc00) at gmain.c:4002
#19 0x00007ffff56658e5 in gst_gl_context_create_thread (context=0x90b310) at gstglcontext.c:1369
#20 0x00007ffff709e675 in g_thread_proxy (data=0x628140) at gthread.c:764
#21 0x00007ffff6a0d4a4 in start_thread () from /usr/lib/libpthread.so.0
#22 0x00007ffff674b12d in clone () from /usr/lib/libc.so.6
Backtrace 3 with GST_GL_PLATFORM=egl GST_GL_API=gles2.
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffed3a4700 (LWP 14147)]
0x00007fffeec56dea in _mesa_test_framebuffer_completeness (ctx=0x7fffeeba0038, fb=fb@entry=0x7fffd8120b20) at main/fbobject.c:1015
1015 att_tex_target = att->Texture->Target;
(gdb) bt
#0 0x00007fffeec56dea in _mesa_test_framebuffer_completeness (ctx=0x7fffeeba0038, fb=fb@entry=0x7fffd8120b20) at main/fbobject.c:1015
#1 0x00007fffeec58d72 in _mesa_check_framebuffer_status (ctx=<optimized out>, buffer=0x7fffd8120b20) at main/fbobject.c:2520
#2 0x00007fffeedb91fd in _mesa_meta_pbo_TexSubImage (ctx=ctx@entry=0x7fffeeba0038, dims=dims@entry=2, tex_image=tex_image@entry=0x7fffd8060940,
xoffset=xoffset@entry=0, yoffset=yoffset@entry=0, zoffset=<optimized out>, zoffset@entry=0, width=320, height=240, depth=1, format=6408, type=5121, pixels=0x0,
allocate_storage=false, create_pbo=false, packing=0x7fffeebbb230) at drivers/common/meta_tex_subimage.c:206
#3 0x00007fffeefb86df in intelTexSubImage (ctx=0x7fffeeba0038, dims=2, texImage=0x7fffd8060940, xoffset=0, yoffset=0, zoffset=0, width=320, height=240, depth=1,
format=6408, type=5121, pixels=0x0, packing=0x7fffeebbb230) at intel_tex_subimage.c:213
#4 0x00007fffeed00507 in _mesa_texture_sub_image (ctx=0x7fffeeba0038, dims=2, texObj=0x7fffd803a0c0, texImage=0x7fffd8060940, target=3553, level=0, xoffset=0,
yoffset=0, zoffset=0, width=320, height=240, depth=1, format=6408, type=5121, pixels=0x0, dsa=false) at main/teximage.c:3531
#5 0x00007fffeed00773 in texsubimage (ctx=0x7fffeeba0038, dims=2, target=3553, level=0, xoffset=0, yoffset=0, zoffset=0, width=320, height=240, depth=1,
format=6408, type=5121, pixels=0x0, callerName=0x7fffef0579e2 "glTexSubImage2D") at main/teximage.c:3589
#6 0x00007fffeed00b98 in _mesa_TexSubImage2D (target=<optimized out>, level=<optimized out>, xoffset=<optimized out>, yoffset=<optimized out>,
width=<optimized out>, height=<optimized out>, format=6408, type=5121, pixels=0x0) at main/teximage.c:3730
#7 0x00007ffff56673e9 in _upload_memory (info=0x7fff967fb698, maxsize=<optimized out>, gl_mem=0x7fff8800f6c0) at gstglmemory.c:459
#8 _gl_mem_map_buffer (gl_mem=0x7fff8800f6c0, info=0x7fff967fb698, maxsize=<optimized out>) at gstglmemory.c:860
#9 0x00007ffff5665f1f in _map_data_gl (context=<optimized out>, transfer=0x7fff967fb3e0) at gstglbasebuffer.c:335
#10 0x00007ffff567aa38 in _run_message_sync (message=0x7fff967fb340) at gstglwindow.c:638
#11 0x00007ffff567a9d2 in _run_message_async (message=0x7fffb8001ce0) at gstglwindow.c:707
#12 0x00007ffff7077c4a in g_main_dispatch (context=0x8c2d70) at gmain.c:3122
#13 g_main_context_dispatch (context=context@entry=0x8c2d70) at gmain.c:3737
#14 0x00007ffff7077fc8 in g_main_context_iterate (context=0x8c2d70, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3808
#15 0x00007ffff70782e2 in g_main_loop_run (loop=0x90afe0) at gmain.c:4002
#16 0x00007ffff56658e5 in gst_gl_context_create_thread (context=0x90b1c0) at gstglcontext.c:1369
#17 0x00007ffff709e675 in g_thread_proxy (data=0x6e06d0) at gthread.c:764
#18 0x00007ffff6a0d4a4 in start_thread () from /usr/lib/libpthread.so.0
#19 0x00007ffff674b12d in clone () from /usr/lib/libc.so.6
(gdb) p att->Texture
$1 = (struct gl_texture_object *) 0x0
(gdb)
Version: 10.6