[RFC] glx: fix DRI2 memory leak

Jesse Barnes jbarnes at virtuousgeek.org
Mon Apr 6 14:57:40 PDT 2009


On Wed, 01 Apr 2009 17:46:08 +0200
Michel Dänzer <michel at daenzer.net> wrote:
> The real problem was pointed out by Pierre Willenbrock: If
> glxPriv->pDraw is a pixmap, DrawableGone() destroys it, then later
> DRI2DestroyDrawable dereferences it... The patch below seems to work
> here - at least it hasn't crashed in a couple of hours, not sure about
> the leak yet.
> 
> Note that unless I'm missing something, it might still be possible for
> this to occur with windows if the underlying DrawableRec is freed
> before this code is reached.
> 
> Also, I don't really understand the logic behind clearing
> glxPriv->pDraw and ->drawId here. In particular, I'm not sure
> DrawableGone will ever be called with glxPriv->refCount > 1. If it
> won't, this change makes the assignments unreachable. And if it will,
> we'll again leak because the cleanup code won't be able to get to the
> underlying DrawableRec?

So are you happy enough with this fix to push it, Michel?  Memory usage
is still high on Intel after the fix, but that may be due to bo
caching, and this is an important fix...

Thanks,
-- 
Jesse Barnes, Intel Open Source Technology Center



More information about the xorg mailing list