[Python-bugs-list] [ python-Bugs-580824 ] getattr crasher
noreply@sourceforge.net
noreply@sourceforge.net
Tue, 16 Jul 2002 11:13:17 -0700
Bugs item #580824, was opened at 2002-07-12 18:54
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=580824&group_id=5470
Category: Python Interpreter Core
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Arman Bostani (arman0)
Assigned to: Nobody/Anonymous (nobody)
Summary: getattr crasher
Initial Comment:
The following crashes the interpreter.
class test:
def __getattr__(self, attr):
return self
test()()
----------------------------------------------------------------------
>Comment By: Tim Peters (tim_one)
Date: 2002-07-16 14:13
Message:
Logged In: YES
user_id=31435
Arman, which version of Python are you using (1.5.2, 2.0,
2.1, 2.1.3, 2.2.1, etc)?
I believe Neal Norwitz added additional recursion-depth
checking in the current CVS head, so in some sense the
most interesting question is whether you still see this happen
in a CVS build (I do not, on Windows). Jeremy, do you still
see it?
----------------------------------------------------------------------
Comment By: Arman Bostani (arman0)
Date: 2002-07-16 14:04
Message:
Logged In: YES
user_id=577382
I'm running on Linux 2.4.17.
I don't think this type of recusrion is actually counted by
ceval right now. At the time of the crash
tstate->recursion_depth is 2. So, setting recusrion limits
will not help.
-arman
----------------------------------------------------------------------
Comment By: Jeremy Hylton (jhylton)
Date: 2002-07-16 13:00
Message:
Logged In: YES
user_id=31392
What platform are you running on? The interpreter tries to
catch this infinite recursion, but there's no portable way
to tell how many C stack frames are too many.
The functions sys.getrecursionlimit() and
sys.setrecursionlimit() can be used to affect this behavior.
If you set the recursion limit to a lower number, you can
prevent the crash. The script Misc/find_recusionlimit.py
will find a safe number for you.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=580824&group_id=5470