[Python-bugs-list] [ python-Bugs-485139 ] mem leak in interpreter from syntax err

noreply@sourceforge.net noreply@sourceforge.net
Fri, 07 Dec 2001 08:46:49 -0800


Bugs item #485139, was opened at 2001-11-24 10:45
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=485139&group_id=5470

Category: Python Interpreter Core
Group: Python 2.2
>Status: Closed
>Resolution: Wont Fix
Priority: 7
Submitted By: Neal Norwitz (nnorwitz)
Assigned to: Guido van Rossum (gvanrossum)
Summary: mem leak in interpreter from syntax err

Initial Comment:
when a syntax error occurs in the interpreter, the
interpreter leaks
see the attached file for more info

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

>Comment By: Guido van Rossum (gvanrossum)
Date: 2001-12-07 08:46

Message:
Logged In: YES 
user_id=6380

Neal writes:

---

I tried:

	for i in range(1000):
	  try:
	    import t2
	  except SyntaxError:
	    print

But that doesn't leak.  I think the reason it doesn't leak
is because 
of the try/except.  I opened the interpreter and
interactively
created syntax errors (=<return>, =<return>, ...) and it
leaked
for each error, not just once 874 bytes, instead of 38 for
1.

If there is a way to raise a syntax error without exitting
the interpreterr
I think it could blow up faster.

-----

My comment: if it only leaks when you don't catch it, that
doesn't bother me much, since that's the end of the process.
:-) So I'm closing this.

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

Comment By: Guido van Rossum (gvanrossum)
Date: 2001-12-06 19:11

Message:
Logged In: YES 
user_id=6380

Neil, can you provide more evidence?  I can't see this leak
in a loop, like this:

| while 1:
|     try: compile("/", "", "exec")
|     except SyntaxError: pass


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

Comment By: Tim Peters (tim_one)
Date: 2001-11-27 12:05

Message:
Logged In: YES 
user_id=31435

Assigned to Barry.

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

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