tech-x11 archive

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

Fix for modular Xorg crash / DRI falling back to SW renderer



The current 1.6.1.901 modular Xorg server (at least the pkgsrc variant)
doesn't deal well with DRI being enabled when it can't load the right
hardware renderer module.  The server crashes trying to clean up un-
initialed state in the fallback-to-software-renderer error handling
code (and at least on my amd64 machine then loops sucking up 100%
of the CPU trying to handle the SEGV).

In my case, the server crashed each time I enabled DRI on a Radeon
HD 4650 (RV730), because it couldn't dlopen /usr/pkg/lib/dri/r600_
dri.so.  With the patch below it happily falls back to the software
renderer; -current native Xorg seems to have the same problem, but
I haven't tested there (either the before or the after case).

---8<------8<------8<------8<------8<------8<------8<------8<---
$NetBSD$

Fix crash when hardware rendering library cannot be loaded.

--- glx/glxdri.c.orig   2009-04-16 14:49:42.000000000 -0400
+++ glx/glxdri.c
@@ -966,6 +966,8 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
     const __DRIextension **extensions;
     int i;
 
+    memset(&framebuffer, 0, sizeof(framebuffer));
+
     if (!xf86LoaderCheckSymbol("DRIQueryDirectRenderingCapable") ||
        !DRIQueryDirectRenderingCapable(pScreen, &isCapable) ||
        !isCapable) {
---8<------8<------8<------8<------8<------8<------8<------8<---

Thanks,
--rafal

-- 
  Time is an illusion; lunchtime, doubly so.     |/\/\|           Rafal Boni
                   -- Ford Prefect               |\/\/|      
rafal%pobox.com@localhost


Home | Main Index | Thread Index | Old Index