hi,<div><br></div><div>what version of mesa?</div><div><br></div><div>might be</div><div><br></div><div> <a href="https://cgit.freedesktop.org/mesa/mesa/commit/?id=9baff597ce021f7691187b0d1d1bbc16d07b13e1">https://cgit.freedesktop.org/mesa/mesa/commit/?id=9baff597ce021f7691187b0d1d1bbc16d07b13e1</a></div><div><br></div><div>Ray<br><br><div class="gmail_quote"><div dir="ltr">On Thu, Aug 30, 2018, 5:00 PM Hans de Goede <<a href="mailto:hdegoede@redhat.com">hdegoede@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
On 30-08-18 22:48, Hans de Goede wrote:<br>
> HI all,<br>
> <br>
> I've been debugging some strange crashes with Xorg-1.20.1 inside<br>
> a virtualbox guest and I can use some help with this.<br>
> <br>
> At first Xorg completely failed to start, running it under<br>
> gdbserver showed a backtrace pointing to a lazy symbol lookup<br>
> failure triggered by:<br>
> <br>
> drmmode_display.c:905:<br>
> return gbm_bo_get_stride(bo->gbm);<br>
> <br>
> Which is part of:<br>
> <br>
> <br>
> uint32_t<br>
> drmmode_bo_get_pitch(drmmode_bo *bo)<br>
> {<br>
> #ifdef GLAMOR_HAS_GBM<br>
> if (bo->gbm)<br>
> return gbm_bo_get_stride(bo->gbm);<br>
> #endif<br>
> <br>
> return bo->dumb->pitch;<br>
> }<br>
> <br>
> Strange enough a LD_PRELOAD of libgbm does not<br>
> fix this and libgbm already gets dragged in by<br>
> libglamor_egl.so so this should not be a problem.<br>
> <br>
> Still I tried this change:<br>
> <br>
> --- a/hw/xfree86/drivers/modesetting/Makefile.am<br>
> +++ b/hw/xfree86/drivers/modesetting/Makefile.am<br>
> @@ -39,7 +39,7 @@ AM_CPPFLAGS = \<br>
> <br>
> modesetting_drv_la_LTLIBRARIES = <a href="http://modesetting_drv.la" rel="noreferrer" target="_blank">modesetting_drv.la</a><br>
> modesetting_drv_la_LDFLAGS = -module -avoid-version<br>
> -modesetting_drv_la_LIBADD = $(UDEV_LIBS) $(DRM_LIBS)<br>
> +modesetting_drv_la_LIBADD = $(UDEV_LIBS) $(DRM_LIBS) $(GBM_LIBS)<br>
> modesetting_drv_ladir = @moduledir@/drivers<br>
> <br>
> modesetting_drv_la_SOURCES = \<br>
> <br>
> And now Xorg will start, still very weird since the<br>
> exact same Xorg binaries work fine on Intel integrated<br>
> gfx where the gbm_bo_get_stride() call also happens ...<br>
> <br>
> <br>
> So with this "fix" it starts, but it crashes as soon as I resize the<br>
> vm-window and thus the screen gets resized:<br>
> <br>
> bt<br>
> #0 OsSigHandler (signo=11, sip=0x7ffc160ad2f0, unused=0x7ffc160ad1c0)<br>
> at osinit.c:114<br>
> #1 <signal handler called><br>
> #2 miModifyPixmapHeader (pPixmap=0x28c4460, width=1920, height=992, depth=-1,<br>
> bitsPerPixel=-1, devKind=7680, pPixData=0x0) at miscrinit.c:64<br>
> #3 0x00007fdc13d64471 in drmmode_xf86crtc_resize (scrn=0x21751f0, width=1920,<br>
> height=992) at drmmode_display.c:3166<br>
> #4 0x00000000004bb9d8 in xf86RandR12ScreenSetSize (pScreen=0x23dc9b0,<br>
> width=1920, height=992, mmWidth=508, mmHeight=262) at xf86RandR12.c:698<br>
> #5 0x00000000005092f0 in ProcRRSetScreenSize (client=0x29c6af0)<br>
> at rrscreen.c:289<br>
> #6 0x000000000043fcee in Dispatch () at dispatch.c:478<br>
> <br>
> And miscrinit.c:64 is hte "{" of:<br>
> <br>
> Bool<br>
> miModifyPixmapHeader(PixmapPtr pPixmap, int width, int height, int depth,<br>
> int bitsPerPixel, int devKind, void *pPixData)<br>
> {<br>
> if (!pPixmap)<br>
> return FALSE;<br>
> <br>
> Which is a strange place to crash. Even more weird after adding a<br>
> breakpoint a bit before drmmode_display.c:3166, I get a segfault<br>
> while stepping through earlier lines, pointing at SmartScheduleTimer()<br>
> and specifically again at the opening "{" as if something is wrong with<br>
> the stack and the stack cannot handle function calls being stacked one<br>
> level deeper.<br>
> <br>
> This makes me wonder if this is a stack depth/overflow issue, does the<br>
> xserver have code somewhere to limit its stacksize and could we be<br>
> hitting that ?<br>
> <br>
> Or maybe a bad interaction with gcc-s stack protection?<br>
> <br>
> This feels as if we are hitting a guard page at the end of the stack<br>
> here?<br>
<br>
One important thing which I only put in the subject, this happens<br>
when using glmamor with llvmpipe, something which is new in 1.20,<br>
older xservers never used glamor on llvmpipe. Things work fine<br>
if I disable glamor in a xorg.conf snippet.<br>
<br>
Arguably we should disable glamor when running on llvmpipe because<br>
of performance reasons, still these crashes should not happen.<br>
<br>
Regards,<br>
<br>
Hans<br>
<br>
_______________________________________________<br>
<a href="mailto:xorg-devel@lists.x.org" target="_blank">xorg-devel@lists.x.org</a>: X.Org development<br>
Archives: <a href="http://lists.x.org/archives/xorg-devel" rel="noreferrer" target="_blank">http://lists.x.org/archives/xorg-devel</a><br>
Info: <a href="https://lists.x.org/mailman/listinfo/xorg-devel" rel="noreferrer" target="_blank">https://lists.x.org/mailman/listinfo/xorg-devel</a></blockquote></div></div>