Ian Romanick wrote:
There are now two patches, one from Egbert Eich (who reported the problem). I haven't had time to look at his as it changes some deep, dark, dri stuff that I wasn't ever involved with, but looks sane nonetheless. His avoids the error reply from the X server, whereas mine copes with it once it arrives. I'm not sure either will help texobj which seems to be a malloc/free bug.Keith Whitwell wrote:The other bug report I've had is triggered in similar circumstances, but goes into an infinite loop inside DRI_VALIDATE_DRAWABLE_INFO(), as a magic stamp value never gets updated because the X protocol message never succeeds -- but it doesn't segfault.
I've got a patch that solves (I hope) that problem, but I'm not sure working around this is a good idea as it seems to result from maybe a double free somewhere...
Yes. The light-05 test in viewperf shows this bug on r200. If you want to send me your patch, I can try it out.
I'm attaching both. I actually think applying *both* is the way to go.
Keith
--- dri_util.c 2002/11/25 14:26:55 1.1.1.3
+++ dri_util.c 2003/02/05 10:17:40
@@ -758,8 +762,8 @@
psp->fullscreen = NULL;
}
}
- __driGarbageCollectDrawables(pcp->driScreenPriv->drawHash);
(*pcp->driScreenPriv->DriverAPI.DestroyContext)(pcp);
+ __driGarbageCollectDrawables(pcp->driScreenPriv->drawHash);
(void)XF86DRIDestroyContext(dpy, scrn, pcp->contextID);
Xfree(pcp);
}
Warning: Remote host denied X11 forwarding.
Index: dri_util.c
===================================================================
RCS file: /cvsroot/dri/xc/xc/lib/GL/dri/dri_util.c,v
retrieving revision 1.6
diff -u -r1.6 dri_util.c
--- dri_util.c 28 Nov 2002 19:16:45 -0000 1.6
+++ dri_util.c 4 Feb 2003 23:06:41 -0000
@@ -618,16 +618,20 @@
&pdp->numBackClipRects,
&pdp->pBackClipRects
)) {
+ /* Error -- eg the window may have been destroyed. Keep going
+ * with no cliprects.
+ */
+ pdp->pStamp = &pdp->lastStamp; /* prevent endless loop */
pdp->numClipRects = 0;
pdp->pClipRects = NULL;
pdp->numBackClipRects = 0;
pdp->pBackClipRects = 0;
- /* ERROR!!! */
}
+ else
+ pdp->pStamp = &(psp->pSAREA->drawableTable[pdp->index].stamp);
DRM_SPINLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID);
- pdp->pStamp = &(psp->pSAREA->drawableTable[pdp->index].stamp);
}
/*****************************************************************/
