[Intel-gfx] bufmgr corruption

Lukas Hejtmanek xhejtman at ics.muni.cz
Fri Mar 6 22:40:30 CET 2009


On Fri, Mar 06, 2009 at 04:25:53PM -0500, Kristian Høgsberg wrote:
> That's not a problem, there's a check to see if it's already
> initialized and return if it is:
> 
>    if (pI830->bufmgr)
>        return;

I did some fprints into drm_intel_bufmgr_gem_init and it *is* really called
twice. But it should be no harm except vasting few bytes of memory.

> > The function I830CloseScreen calls dri_bufmgr_destroy which frees the bufmgr.
> > However, *after* this call, calls to i830_uxa_destroy_pixmap are still made
> > (from FreeResources call of the Xserver) which result in bad things
> > (segfaults, memory corruption and so on).
> 
> Hmm, so should we move the dri_bufmgr_destroy() call to after the
> (*pScreen->CloseScreen)() call?

most probably. I'm not familiar with ordering of pScreen calls but using
fprints, I could see something like this in the log:

Unreference addr 0x13c01d8, bufmgr addr 0x13c01c0
Setting master 
Unreference addr 0x412fb78, bufmgr addr 0x412fb60
[...]
Called destroy!
.Dropping master 
Called destroy!
NULL! bufmgr addr 0x4649e80, unrefaddr 0x13c01d8 
NULL! bufmgr addr 0x4579780, unrefaddr 0x13c01d8 

"Unreference addr.." print is frim drm_intel_bufmgr_gem_init()
Called destroy message is from drm_intel_bufmgr_gem_destroy()

and "NULL! bufmgr..." is from drm_intel_bo_unreference() (if bo->bufmgr is valid
but bo->bufmgr->bo_unreference is not valid and the drm_intel_bo_unreference()
is called anyway).

-- 
Lukáš Hejtmánek



More information about the Intel-gfx mailing list