Bug 64324

Summary: memory leak of visual info
Product: Mesa Reporter: Andy Skinner <askinner>
Component: Drivers/X11Assignee: mesa-dev
Status: RESOLVED MOVED QA Contact:
Severity: minor    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Andy Skinner 2013-05-07 16:03:18 UTC
This is a small leak (64 bytes) that happens as we allocate and free Visuals and FBConfigs in X11.  Brian Paul mentioned that he wouldn't be sure it was a leak without study, so I figured I'd propose it here, just to track it.

XMesaCreateVisual allocates an XMesaVisual, then allocates an XVisualInfo and copies into it the XVisualInfo that was passed into the function, and stores the pointer in the XMesaVisua, as visinfo.

XMesaDestroyVisual calls free on both the XVisualInfo and the XMesaVisual.  This is never called.

But destroy_visuals_on_display(), in fakeglx.c, only calls free on the XMesaVisual.  Nothing frees the XVisualInfo that was copied into the pointer stored in XMesaVisual.

I don't know whether destroy_visuals_on_display() should call XMesaDestroyVisual(VisualTable[i]), or should just free(VisualTable[i]->visinfo).

Thanks
andy
Comment 1 Andy Skinner 2014-07-21 20:47:47 UTC
Any chance someone could look at this?  We still get it reported as a leak, though it is in a large system and it would be hard to send a repro case.  I admit we have't updated in a while, but the code is the same.  If we could see this isn't a bug and we are using something wrong (our  use of Mesa here is inside another 3rd party software library), that would also help.

The difference between XMesaDestroyVisual (frees a single XMesaVisual and its XMesaVisualInfo) and destroy_visuals_on_display (only frees an array of XMesaVisuals but not their XMesaVisualInfos) seems clear.  If destroy_visuals_on_display is not supposed to free the XVisualInfo, what is?

The leaking object is said to be allocated in XGetVisualInfo, called from Fake_glXGetFBConfigs.

Thanks.
Comment 2 GitLab Migration User 2019-09-18 16:56:12 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/mesa/mesa/issues/44.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.