Source-Changes-HG archive

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

[xsrc/trunk]: xsrc/external/mit/xorg-server/dist/glx Undo local diff.



details:   https://anonhg.NetBSD.org/xsrc/rev/c3b544d2a42b
branches:  trunk
changeset: 10277:c3b544d2a42b
user:      maya <maya%NetBSD.org@localhost>
date:      Fri May 31 18:01:11 2019 +0000

description:
Undo local diff.

It was introduced as one of the patches fixing
https://bugs.freedesktop.org/show_bug.cgi?id=28181

This is marked fixed upstream, and was spotted on non-NetBSD, so it's
very likely to be unnecessary.

This diff was causing a double-free, causing Xorg to crash when closing
pkgsrc/emulators/{retroarch,nestopia}.
This is most likely a problem that became more evident from jemalloc
debug which is filling free'd memory with 0x5a5a5a...

Fixes PR xsrc/54246.

diffstat:

 external/mit/xorg-server/dist/glx/glxcmds.c     |   5 +----
 external/mit/xorg-server/dist/glx/glxdrawable.h |   1 -
 external/mit/xorg-server/dist/glx/glxext.c      |  12 +++++-------
 3 files changed, 6 insertions(+), 12 deletions(-)

diffs (58 lines):

diff -r 6cd4aa30d748 -r c3b544d2a42b external/mit/xorg-server/dist/glx/glxcmds.c
--- a/external/mit/xorg-server/dist/glx/glxcmds.c       Thu May 16 09:59:37 2019 +0000
+++ b/external/mit/xorg-server/dist/glx/glxcmds.c       Fri May 31 18:01:11 2019 +0000
@@ -1137,7 +1137,6 @@
     drawable->pDraw = pDraw;
     drawable->type = type;
     drawable->drawId = drawId;
-    drawable->otherId = 0;
     drawable->config = config;
     drawable->eventMask = 0;
 
@@ -1172,10 +1171,8 @@
      * Windows aren't refcounted, so track both the X and the GLX window
      * so we get called regardless of destruction order.
      */
-    // XXXMRG xorg-server 1.10
-    if (drawableId != glxDrawableId && (type == GLX_DRAWABLE_WINDOW /*|| type == GLX_DRAWABLE_PIXMAP*/) &&
+    if (drawableId != glxDrawableId && type == GLX_DRAWABLE_WINDOW &&
         !AddResource(pDraw->id, __glXDrawableRes, pGlxDraw))
-       /*pGlxDraw->destroy (pGlxDraw);*/
         return BadAlloc;
 
     return Success;
diff -r 6cd4aa30d748 -r c3b544d2a42b external/mit/xorg-server/dist/glx/glxdrawable.h
--- a/external/mit/xorg-server/dist/glx/glxdrawable.h   Thu May 16 09:59:37 2019 +0000
+++ b/external/mit/xorg-server/dist/glx/glxdrawable.h   Fri May 31 18:01:11 2019 +0000
@@ -53,7 +53,6 @@
 
     DrawablePtr pDraw;
     XID drawId;
-    XID otherId; /* for glx1.3 we need to track the original Drawable as well */
 
     /*
      ** Either GLX_DRAWABLE_PIXMAP, GLX_DRAWABLE_WINDOW or
diff -r 6cd4aa30d748 -r c3b544d2a42b external/mit/xorg-server/dist/glx/glxext.c
--- a/external/mit/xorg-server/dist/glx/glxext.c        Thu May 16 09:59:37 2019 +0000
+++ b/external/mit/xorg-server/dist/glx/glxext.c        Fri May 31 18:01:11 2019 +0000
@@ -97,15 +97,13 @@
 {
     __GLXcontext *c, *next;
 
-    if (glxPriv->type == GLX_DRAWABLE_WINDOW || glxPriv->type == GLX_DRAWABLE_PIXMAP) {
+    if (glxPriv->type == GLX_DRAWABLE_WINDOW) {
         /* If this was created by glXCreateWindow, free the matching resource */
-        if (glxPriv->otherId) {
-            XID other = glxPriv->otherId;
-            glxPriv->otherId = 0;
-            if (xid == other)
+        if (glxPriv->drawId != glxPriv->pDraw->id) {
+            if (xid == glxPriv->drawId)
+                FreeResourceByType(glxPriv->pDraw->id, __glXDrawableRes, TRUE);
+            else
                 FreeResourceByType(glxPriv->drawId, __glXDrawableRes, TRUE);
-            else
-                FreeResourceByType(other, __glXDrawableRes, TRUE);
         }
         /* otherwise this window was implicitly created by MakeCurrent */
     }



Home | Main Index | Thread Index | Old Index