Core dump with increased recursionlimit

Nick Craig-Wood nick at
Tue Oct 12 19:30:11 CEST 2004

<exarkun at> wrote:
>  On 12 Oct 2004 09:29:58 GMT, Nick Craig-Wood <nick at> wrote:
> >I've just discovered that my python (Python 2.3.4 from debian package
> > 2.3.4-1 running on debian testing x86 + linux 2.4.26) core dumps when
> > I set recursionlimit very high and do lots of recursion.
>  You probably have a buggy version of glibc.  There is a version
>  which automatically sets the stack limit to a fairly small value (I
>  forget what the limit is exactly, 2 MB perhaps).  If this is the
>  case and you strace your program, you will see a setrlimit() call
>  near the beginning of the run.

Spot on!

getrlimit(RLIMIT_STACK, {rlim_cur=RLIM_INFINITY, rlim_max=RLIM_INFINITY}) = 0
setrlimit(RLIMIT_STACK, {rlim_cur=2044*1024, rlim_max=RLIM_INFINITY}) = 0

So its 1 page less than 2 MB.

Reading a bit more - this didn't affect my test C program because it
didn't use pthreads.

I'll look out for a glibc upgrade!

Nick Craig-Wood <nick at> --

More information about the Python-list mailing list