Bug 2731 - Memory leak in Xcursor
Summary: Memory leak in Xcursor
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Lib/Xcursor (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: high major
Assignee: Keith Packard
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-14 21:23 UTC by Kyle Bateman
Modified: 2011-10-15 17:07 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Demonstrates leak (545 bytes, text/plain)
2005-03-14 21:24 UTC, Kyle Bateman
no flags Details
Another demo script (1.60 KB, text/plain)
2005-03-14 21:24 UTC, Kyle Bateman
no flags Details
Another demo script (281 bytes, text/plain)
2005-03-14 21:24 UTC, Kyle Bateman
no flags Details
Fix 3 leaks triggered by the testcase and GTK+ (1.09 KB, patch)
2007-01-03 15:01 UTC, Chris Wilson
no flags Details | Splinter Review

Description Kyle Bateman 2005-03-14 21:23:11 UTC
I have been chasing a memory leak in my Xserver on Fedora core 1 through 3. 
This problem is present on both XFree86 and the xorg release in Fedora 3.

If a cursor theme is enabled, the attached test programs will produce a leak in
the X server.  The C program (leak.c) leaks only when it is running.  membug2
will allocate memory that stays allocated after the program terminates (try an
argument of 500), however, you can shrink the allocation back down by running it
with a small argument (like 1).  membug will allocate memory in the server and
never give it back no matter what you do (push the button a bunch of times).

When I disable the theme as follows, the memory leak totally goes away:

cd /usr/share/icons/default
mv index.theme index.theme.save
Ctrl-Alt-Bksp

Here are some other posts to the TCL and Redhat bugzillas:

https://bugzilla.redhat.com/beta/show_bug.cgi?id=150747
http://sourceforge.net/tracker/index.php?func=detail&aid=1157298&group_id=10894&atid=110894
Comment 1 Kyle Bateman 2005-03-14 21:24:09 UTC
Created attachment 2109 [details]
Demonstrates leak
Comment 2 Kyle Bateman 2005-03-14 21:24:39 UTC
Created attachment 2110 [details]
Another demo script
Comment 3 Kyle Bateman 2005-03-14 21:24:59 UTC
Created attachment 2111 [details]
Another demo script
Comment 4 Chris Wilson 2007-01-03 15:01:49 UTC
Created attachment 8286 [details] [review]
Fix 3 leaks triggered by the testcase and GTK+
Comment 5 Chris Wilson 2011-04-01 04:18:45 UTC
commit 073eb2c56f4794275eee40a825dbfe1232bb2690
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Apr 1 12:14:51 2011 +0100

    Free list on shutdown.
    
    We freed the parent structure without freeing the list contained within,
    making valgrind unhappy.
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

commit f49e7e1608f2dac140f60bcae21d5c37f79fc41b
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Apr 1 12:15:46 2011 +0100

    Free the partial header after failing to open the cursor.
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

commit bee68e54e5c3a4b9f46c81366a720531e3e07a82
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Apr 1 12:16:23 2011 +0100

    Free the FontInfo structure after loading the cursor from it.
    
    References: https://bugs.freedesktop.org/show_bug.cgi?id=2731
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>


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.