This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Recursion limit too high for MacOSX
Type: Stage:
Components: None Versions:
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: jackjansen, jhylton, loewis, skip.montanaro
Priority: normal Keywords:

Created on 2003-06-18 13:01 by jackjansen, last changed 2022-04-10 16:09 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
t.py jackjansen, 2003-06-18 13:01
Messages (5)
msg16466 - (view) Author: Jack Jansen (jackjansen) * (Python committer) Date: 2003-06-18 13:01
Python's recursion limit is too high for Mac OS X, where the 
default stack size is 512K. The attached script will never 
trigger a maximum recursion depth exception, it will have 
crashed Python with a segmentation violation before that.

A possible solution is a call to sys.setrecursionlimit() in 
site.py, another is to change the number "1000" in ceval.c 
to a configure-time constant.

Other platforms may also suffer this problem, it may be a 
good idea to add a test_stackoverflow.

I'm willing to do the work involved, but I'd like some 
feedback first.
msg16467 - (view) Author: Jeremy Hylton (jhylton) (Python triager) Date: 2003-06-18 15:40
Logged In: YES 
user_id=31392

I'd like to see a per-platform recusion limit, because the
limit could be much higher on Linux and Windows than 1000.
msg16468 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2003-06-21 13:50
Logged In: YES 
user_id=21627

If more work is put into recursion limits, I think platform
mechanisms should be used where available. For example,
there might be ways to find out, at run-time, what the stack
consumption is, and what the stack availalability is, and
compute a recursion limit from that.
msg16469 - (view) Author: Jack Jansen (jackjansen) * (Python committer) Date: 2003-06-22 21:59
Logged In: YES 
user_id=45365

A runtime mechanism is already available (PyOS_CheckStack), 
but it is only used on platforms where a stack overrun would be 
disastrous (i.e. run into your heap in stead of giving a SEGV), 
because it is pretty expensive. If there is a common way to do 
this easier (i.e. set a red zone pointer and do one pointer 
compare in a stack test macro) I would be all for it, bt I don't 
know how to do this.
msg55405 - (view) Author: Skip Montanaro (skip.montanaro) * (Python triager) Date: 2007-08-29 01:50
This problem seems to have been fixed.  The
submitted test case yields maximum recursion
depth exceeded on both 2.5 and 2.6a0.
History
Date User Action Args
2022-04-10 16:09:19adminsetgithub: 38674
2007-10-11 22:58:18brett.cannonsetstatus: open -> closed
2007-08-29 01:50:58skip.montanarosetnosy: + skip.montanaro
resolution: out of date
messages: + msg55405
2003-06-18 13:01:06jackjansencreate