[Python-bugs-list] [ python-Bugs-572567 ] Memory leak in object comparison

noreply@sourceforge.net noreply@sourceforge.net
Sat, 22 Jun 2002 12:17:25 -0700


Bugs item #572567, was opened at 2002-06-22 14:17
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=572567&group_id=5470

Category: Python Interpreter Core
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Kevin Jacobs (jacobs99)
Assigned to: Nobody/Anonymous (nobody)
Summary: Memory leak in object comparison

Initial Comment:
There is a rather obscure memory leak caused
by a missing Py_DECREF one of the comparison
function wrappers in typeobject.c.  It is obscure only 
because it inflates the reference count on methods,
which is why it has gone unnoticed since its inital
checkin on 8/15/2001.  Unfortunately, one of my
meta-class experiments triggers this code on
many ephemoral class instances, and thus leaks 
heaping chunks of memory (or a heaping number of 
little chunks, if you like).

I've attached the simple one line fix, which should
be applied to the next 2.2.x release, and certainly
to the 2.3 CVS tree.  To make myself really useful, 
I've also audited the rest of typeobject.c to make sure 
that all users of 'lookup_method', the source of the 
leaked reference, properly handle its results.


----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=572567&group_id=5470