Bug 7512

Summary: Memory leak with GLX pixmaps
Product: xorg Reporter: jpc
Component: Server/Ext/GLXAssignee: Allen Lorenz <allenlorenz>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: high    
Version: unspecified   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 8888, 16399    
Attachments:
Description Flags
demo file
none
xorg.conf
none
Xorg.log none

Description jpc 2006-07-13 08:03:28 UTC
I have a pb with the size of the Xserver growing when using gtkglext
The problem can be reproduces by the pixmap demo of gtkglext 
(run the demo then change a lot the window size in order to free and allocate 
many pixmaps). It seams that this pb does not appear on all the platforms/drivers. 
But I had this pb on at least five machines with diff. graphic cards and drivers. 

In order to check the pb I have tried a small program indep of gtkglext which 
is attached. 
when running this program the X server grows and the memory is not released 
when the program ends. 

the program basilcally loops (1000 times) on 

ourData->pm = XCreatePixmap(..)
ourData->glxpm= glXCreateGLXPixmap
glXMakeCurrent( ourData->dpy, ourData->glxpm, ourData->ctx ); 
glXMakeCurrent( ourData->dpy, None, NULL);
glXDestroyPixmap(ourData->dpy,ourData->glxpm);
XFreePixmap(ourData->dpy,ourData->pm);

if glXMakeCurrent( ourData->dpy, ourData->glxpm, ourData->ctx ); is commented 
the memory leak does not appear if glXMakeCurrent( ourData->dpy, ourData->glxpm,
ourData->ctx ) is present it seams that XFreePixmap does not do its job. 

Maybe I'm doing something wrong.
Comment 1 jpc 2006-07-13 08:05:33 UTC
Created attachment 6213 [details]
demo file
Comment 2 Erik Andren 2006-07-30 08:22:12 UTC
Please post your xorg.conf and your xorg log. 
Comment 3 jpc 2006-07-31 03:53:28 UTC
Created attachment 6407 [details]
xorg.conf

xorg.conf on a Dell GX620
Comment 4 jpc 2006-07-31 03:54:42 UTC
Created attachment 6408 [details]
Xorg.log 

Xorg.log
Comment 5 Erik Andren 2006-07-31 04:02:02 UTC
Are you also experiencing this with a more current version of the xorg-server?
Comment 6 jpc 2006-07-31 04:37:55 UTC
(In reply to comment #5)
> Are you also experiencing this with a more current version of the xorg-server?

Yes I think I have the same pb on a laptop with Fedora Core 5 and 
a more current version of the xorg-server. 
Comment 7 Adam Jackson 2006-10-12 18:27:05 UTC
Adding to 7.2 tracker to see if we can hunt this down.
Comment 8 Daniel Stone 2007-02-27 01:32:54 UTC
Sorry about the phenomenal bug spam, guys.  Adding xorg-team@ to the QA contact so bugs don't get lost in future.
Comment 9 Adam Jackson 2007-04-08 13:38:29 UTC
Move to 7.3 tracker.
Comment 10 jpc 2007-09-11 00:18:56 UTC
(In reply to comment #9)
> Move to 7.3 tracker.

Since the bug report, I have now a Fedora Core 7 release 
and now the program crashes ! trying to discover the carsh 
origin I have detected that the glxpixmap demo of Mesa 
was crashing the same way: Mesa-7.0/progs/xdemos/glxpixmap.c 

  Error of failed request:  GLXBadContext
  Major opcode of failed request:  143 (GLX)
  Minor opcode of failed request:  5 (X_GLXMakeCurrent)
  Serial number of failed request:  30
  Current serial number in output stream:  30

this happens on a Dell GX620 with the Intel driver. 
It works fine on an other machine with nvidia driver (proprietary one).
This bug is really blocking for me !

Comment 11 Michel Dänzer 2009-04-30 07:23:17 UTC
There was a GLX pixmap leak fix in xserver 1.6.1, though I'm not sure it's the same problem. You may wanna give it a shot though.
Comment 12 Daniel Stone 2009-08-31 18:03:12 UTC
closing as probably fixed due to feedback timeout -- if this problem still occurs, please reopen.  thanks.
Comment 13 Daniel Stone 2009-08-31 18:03:20 UTC
closing as probably fixed due to feedback timeout -- if this problem still occurs, please reopen.  thanks.
Comment 14 jpc 2009-08-31 22:21:23 UTC
As far as I can understand, the bug is not fixed. 
But the formulation has maybe evolved. 
For example, the basic mesa demo with pixmaps fail on intel graphics and
my application still crashes on intel graphics (works on nvidia) when I 
try to use opengl with pixmap rendering.
Regularly some people are talking about problems with Opengl 
with pixmaps rendering on the gtkglext mailing list.
I will try to update the demo.
Comment 15 Michel Dänzer 2009-09-01 00:13:39 UTC
(In reply to comment #14)
> For example, the basic mesa demo with pixmaps fail on intel graphics and
> my application still crashes on intel graphics (works on nvidia) when I 
> try to use opengl with pixmap rendering.

That's not the same as a memory leak, so it would need to be tracked separately. However, this should be fixed in Mesa Git and the upcoming 7.5.1 release.

If you're still seeing leaks with at least xserver 1.6.x and Mesa 7.5.x, please try to get more information about them, e.g. with valgrind or Odin (http://cgit.freedesktop.org/~ickle/odin/).
Comment 16 Kristian Høgsberg 2010-05-07 16:49:22 UTC
Closing again, as it looks like the leak originally reported is fixed.  Additionally, the bug was reopened because glx pixmaps crashes, but the glxgear_pixmap demo from mesa work just fine here.  If there still is a problem with glx pixmaps and you have a test case that demonstrates this, please file a new bug and attach the test case there.  Thanks.

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.