tech-x11 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Crashes in X11R7/lib/modules/dri/r600_dri.so (7.0.1)



Dear Olaf,

On 2016-11-03, Rhialto wrote:
> I'm sometimes working on VICE (the Commodore 8-bit emulator) and its GTK
> GUI uses GL for hardware-accelerated scaling of the emulated screen.
> 
> Unfortunately I always get segfaults in the r600_dri.so library. This is
> the one that gets used for (some?) Radeon graphics cards.
> 
> The segfaults don't occur if I run the same program on a laptop with
> Intel graphics.
> 
> Inserting a debugging printf() seems to delay the occurrence of the
> segfaults (but does not prevent them), suggesting some race condition.
> The DRI library seems to create an extra thread for its own use; VICE
> (in the tested version) is single-threaded.
> 
> (gdb) thread 2
> [Switching to thread 2 (LWP 2)]
> #0  0x00007f7fe9c9f6aa in ___lwp_park60 () from /usr/lib/libc.so.12
> (gdb) bt
> #0  0x00007f7fe9c9f6aa in ___lwp_park60 () from /usr/lib/libc.so.12
> #1  0x00007f7fea008f2b in pthread_cond_timedwait ()
>    from /usr/lib/libpthread.so.1
> #2  0x00007f7fdd6bdbc9 in ?? () from /usr/X11R7/lib/modules/dri/r600_dri.so
> #3  0x00007f7fdd6bd66d in ?? () from /usr/X11R7/lib/modules/dri/r600_dri.so
> #4  0x00007f7fea00a9cc in ?? () from /usr/lib/libpthread.so.1
> #5  0x00007f7fe9c83de0 in ?? () from /usr/lib/libc.so.12
> #6  0x00010102464c457f in ?? ()
> #7  0x0000000000000000 in ?? ()
> 
> I replaced the /usr/X11R7 library from 7.0.1 with a -current version
> from august, but to keep DRI working I had to get the
> /usr/X11R7/lib/modules/dri directory back from 7.0.1 (glxgears didn't
> work otherwise). This didn't help (nor make it worse).
> 
> Source:
> https://sourceforge.net/p/vice-emu/code/HEAD/tree/trunk/vice/src/arch/unix/x11/gnome/x11ui.c
> 
> The locations of the crash are most of the time the same, but not
> always. This one is very common:
> 
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to LWP 1]
> 0x00007f7fdd742551 in r600_draw_rectangle ()
>    from /usr/X11R7/lib/modules/dri/r600_dri.so
> (gdb) bt
> #0  0x00007f7fdd742551 in r600_draw_rectangle ()
>    from /usr/X11R7/lib/modules/dri/r600_dri.so
> #1  0x00007f7fdd74862c in util_blitter_custom_color ()
>    from /usr/X11R7/lib/modules/dri/r600_dri.so
> #2  0x00007f7fdd7016b7 in ?? () from /usr/X11R7/lib/modules/dri/r600_dri.so
> #3  0x00007f7fdd4a1c0e in dri_flush ()
>    from /usr/X11R7/lib/modules/dri/r600_dri.so
> #4  0x00007f7fefc59782 in ?? () from /usr/X11R7/lib/libGL.so.2
> #5  0x00000000005fe55b in gl_render_canvas (do_swap=1, to=0, from=0, 
>     buffers=0xcade60 <t>, canvas=<optimized out>, w=<optimized out>)
>     at ../../../../../../vice/src/arch/unix/x11/gnome/x11ui.c:1938
> 
>     [ x11ui.c:1938 is the call to gdk_gl_drawable_swap_buffers() ]
> 
> #6  exposure_callback_canvas (w=<optimized out>, e=<optimized out>, 
>     client_data=<optimized out>)
>     at ../../../../../../vice/src/arch/unix/x11/gnome/x11ui.c:2004
> #7  0x00007f7ff692f3e8 in ?? () from /usr/pkg/lib/libgtk-x11-2.0.so.0
> #8  0x00007f7ff240f1cf in g_closure_invoke ()
>    from /usr/pkg/lib/libgobject-2.0.so.0
> ...
> 
> This one is more common of the #if 0 part of the code is enabled:
> See around line 1914.
> 
> Program received signal SIGSEGV, Segmentation fault.
> 0x00007f7fe9d0dbdf in memcpy () from /usr/lib/libc.so.12
> (gdb) bt
> #0  0x00007f7fe9d0dbdf in memcpy () from /usr/lib/libc.so.12
> #1  0x00007f7fdd77c91a in u_upload_data ()
>    from /usr/X11R7/lib/modules/dri/r600_dri.so
> #2  0x00007f7fdd6eed65 in ?? () from /usr/X11R7/lib/modules/dri/r600_dri.so
> #3  0x00007f7fdd779ffb in cso_set_constant_buffer ()
>    from /usr/X11R7/lib/modules/dri/r600_dri.so
> #4  0x00007f7fdd58646e in st_upload_constants ()
>    from /usr/X11R7/lib/modules/dri/r600_dri.so
> #5  0x00007f7fdd57e0d6 in st_validate_state ()
>    from /usr/X11R7/lib/modules/dri/r600_dri.so
> #6  0x00007f7fdd553a44 in st_draw_vbo ()
>    from /usr/X11R7/lib/modules/dri/r600_dri.so
> #7  0x00007f7fdd59a8f3 in vbo_exec_vtx_flush ()
>    from /usr/X11R7/lib/modules/dri/r600_dri.so
> #8  0x00007f7fdd5a0826 in ?? () from /usr/X11R7/lib/modules/dri/r600_dri.so
> #9  0x00007f7fdd5af442 in vbo_exec_FlushVertices ()
>    from /usr/X11R7/lib/modules/dri/r600_dri.so
> #10 0x00007f7fdd6ac282 in ?? () from /usr/X11R7/lib/modules/dri/r600_dri.so
> #11 0x00007f7fdd6ad117 in _mesa_set_enable ()
>    from /usr/X11R7/lib/modules/dri/r600_dri.so
> #12 0x00000000005fe55d in gl_render_canvas (do_swap=1, to=0, from=0, 
>     buffers=0xcade60 <t>, canvas=<optimized out>, w=<optimized out>)
>     at ../../../../../../vice/src/arch/unix/x11/gnome/x11ui.c:1921
> 
>     [ x11ui.c:1921 is probably the line after static int x = 0; ]
> 
> #13 exposure_callback_canvas (w=<optimized out>, e=<optimized out>, 
>     client_data=<optimized out>)
>     at ../../../../../../vice/src/arch/unix/x11/gnome/x11ui.c:2002
> 
> I don't quite see how this can be an application bug (but who knows...).
> So is it a bug in r600_dri.so?

Is it perhaps kern/49838 ?

The bug report suggests a workaround near the end:

--- external/mit/MesaLib/dist/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c.orig	2015-05-01 23:16:34.000000000 +0200
+++ external/mit/MesaLib/dist/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c	2015-05-01 23:17:35.000000000 +0200
@@ -709,8 +709,10 @@
 
     ws->ncs = 0;
     pipe_semaphore_init(&ws->cs_queued, 0);
+#if 0
     if (ws->num_cpus > 1 && debug_get_option_thread())
         ws->thread = pipe_thread_create(radeon_drm_cs_emit_ioctl, ws);
+#endif
 
     /* Create the screen at the end. The winsys must be initialized
      * completely.


-- 
Kind regards,

Yorick Hardy


Home | Main Index | Thread Index | Old Index