[Python-bugs-list] [ python-Bugs-789402 ] Memory leak on open() only in 2.3?

SourceForge.net noreply at sourceforge.net
Tue Aug 19 07:52:40 EDT 2003


Bugs item #789402, was opened at 2003-08-15 13:23
Message generated for change (Comment added) made by jdalambert
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=789402&group_id=5470

Category: Python Interpreter Core
Group: Python 2.3
Status: Open
Resolution: Fixed
Priority: 5
Submitted By: David Lambert (jdalambert)
Assigned to: Neal Norwitz (nnorwitz)
Summary: Memory leak on open() only in 2.3?

Initial Comment:


If  for instance /tmp is a directory, then the follwing
code fragment produces a large memory leak on Python
2.3 compiled on Linux 2.4.20. This does not appear to
be a problem with previous versions of the interpreter.


#!/usr/local/bin/python


while 1:
    try:
        open('/tmp')
    except:
        pass

It appears that the exception IOError: [Error 21] Is a
directory leave garbage. If the parameter to open()
does not exist, the problem does not occur.


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

>Comment By: David Lambert (jdalambert)
Date: 2003-08-19 08:52

Message:
Logged In: YES 
user_id=845425

Over the weekend and through Monday I ran my system 24/7
with the previously attached code. There do not seem to be
any problems, but I am waiting for your "blessing" before
considering it a fix.


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

Comment By: David Lambert (jdalambert)
Date: 2003-08-16 18:09

Message:
Logged In: YES 
user_id=845425

I think I may have a fix. Check out the attached file. It
seems to work for me.

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

Comment By: Neal Norwitz (nnorwitz)
Date: 2003-08-15 15:07

Message:
Logged In: YES 
user_id=33168

Wow, it sure does leak!

Checked in as:  Objects/fileobject.c 2.180

Still needs a test.  Leaving open until I get around to it.

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

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



More information about the Python-bugs-list mailing list