[Python-bugs-list] [ python-Bugs-580824 ] getattr crasher

noreply@sourceforge.net noreply@sourceforge.net
Tue, 16 Jul 2002 11:04:15 -0700


Bugs item #580824, was opened at 2002-07-12 22: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: Arman Bostani (arman0)
Date: 2002-07-16 18: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 17: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