"ulimit -s" has no effect?

Maciej Kalisiak mac at dgp.toronto.edu
Wed Feb 4 23:34:00 EST 2004


I use this simple test in Python:

def foo(i):
        print i 
        foo(i+1)
import sys
sys.setrecursionlimit(1000000)
foo(0)

Now, my understanding is that I get the segfault when Python overruns the C
stack.  Naturally the last number printed should go up when I increase the
stack size in the shell before calling Python, by using "ulimit -s <number 
of k>".   But this seems to not be the case.  Whatever value I use with
ulimit, Python always segfaults at the same recursion depth.  Any advice on
how to get things to work proper with this?

 % python -V
Python 2.3.3
 % uname -a
Linux isildur 2.4.24-1-686 #1 ...



More information about the Python-list mailing list