[Mesa-dev] Fwd: GLX_INTEL_swap_event crashes driver when swapping window buffers

Daniel Manjarres danmanj at gmail.com
Sun Aug 26 09:25:34 PDT 2012


Hi, I'm just forwarding this message that I sent to debian upstream to you guys too.

Have great day!

-------- Original Message --------
Subject: 	GLX_INTEL_swap_event crashes driver when swapping window buffers
Date: 	Sun, 19 Aug 2012 12:30:30 -0700
From: 	Daniel Manjarres <danmanj at gmail.com>
To: 	submit at bugs.debian.org



Package: libgl1-mesa-glx
Version: 8.0.4-1
Severity: important
Tags: patch, upstream

Dear Maintainer,
When enabling GLX_INTEL_swap_event for windows:
in the file src/glx/dri2.c:
DRI2WireToEvent assumes the event it is generating is asociated with a
GLXPixmap, and tries to look up the pixmap in the glxDrawHash hash
table, but as the buffer swap is for a _WINDOW_ not a pixmap the result
is NULL. DRI2WireToEvent then dereferences the null pointer, and SEGVs.

The attached patch handles this situation gracefully.

diff --git b/src/glx/dri2.c a/src/glx/dri2.c
index b1b5013..2cbe968 100644
--- b/src/glx/dri2.c
+++ a/src/glx/dri2.c
@@ -130,10 +130,17 @@ DRI2WireToEvent(Display *dpy, XEvent *event, xEvent *wire)
         aevent->msc = ((CARD64)awire->msc_hi<<  32) | awire->msc_lo;

         glxDraw = GetGLXDrawable(dpy, pdraw->drawable);
-      if (awire->sbc<  glxDraw->lastEventSbc)
-        glxDraw->eventSbcWrap += 0x100000000;
-      glxDraw->lastEventSbc = awire->sbc;
-      aevent->sbc = awire->sbc + glxDraw->eventSbcWrap;
+      if(glxDraw)
+      {
+         if (awire->sbc<  glxDraw->lastEventSbc)
+           glxDraw->eventSbcWrap += 0x100000000;
+         glxDraw->lastEventSbc = awire->sbc;
+         aevent->sbc = awire->sbc + glxDraw->eventSbcWrap;
+      }
+      else
+      {
+         aevent->sbc = awire->sbc;
+      }

         return True;
      }




More information about the mesa-dev mailing list