[Python-Dev] stack check on Unix: any suggestions? (original) (raw)

Thomas Wouters thomas@xs4all.net
Thu, 31 Aug 2000 23:38:59 +0200


On Thu, Aug 31, 2000 at 10:58:49AM -0500, Guido van Rossum wrote:

C() # This tries to get init, triggering the recursion

I get 5788 iterations on Red Hat Linux 6.2 (ulimit -c says 8192; I have no idea what units).

That's odd... On BSDI, with a 2Mbyte stacklimit (ulimit -s says 2048) I get almost as many recursions: 5136. That's very much not what I would expect... With a stack limit of 8192, I can go as high as 19997 recursions! I wonder why that is...

Wait a minute... The Linux SEGV isn't stacksize related at all! Observe:

centurion:~ > limit stacksize 8192 centurion:~ > python teststack.py | tail -3 5134 5135 5136 Segmentation fault (core dumped)

centurion:~ > limit stacksize 65536 centurion:~ > python teststack.py | tail -3 5134 5135 5136 Segmentation fault (core dumped)

centurion:~ > limit stacksize 2048 centurion:~ > python teststack.py | tail -3 5134 5135 5136 Segmentation fault (core dumped)

centurion:~ > limit stacksize 128 centurion:~ > python teststack.py | tail -3 Segmentation fault (core dumped)

centurion:~ > limit stacksize 1024 centurion:~ > python teststack.py | tail -3 2677 2678 26Segmentation fault (core dumped)

centurion:~ > limit stacksize 1500 centurion:~ > python teststack.py | tail -3 3496 3497 349Segmentation fault (core dumped)

I don't have time to pursue this, however. I'm trying to get my paid work finished tomorrow, so that I can finish my real work over the weekend: augassign docs & some autoconf changes :-)

-- Thomas Wouters <thomas@xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!