[issue1881] increase parser stack limit

Maciek Fijalkowski report at bugs.python.org
Tue Jan 22 12:29:14 CET 2008


Maciek Fijalkowski added the comment:

PyPy is all MIT, no problem at license. This should not be plugged into 
the parser, this is not a patch (especially not a patch for the parser). 
This file is rather to illustrate possible solution to solve the problem 
of sys.setrecursionlimit not being a robust solution, but just a quick 
hack. Instead of having a counter (which is sometimes too big, sometimes 
too small, depending on amount of C code in between the stack checks), 
it provides a way of measuring the size of a stack actually used. The 
idea is to store the address of local variable somewhere in the 
beginning and compare it to addresses of local variables in consecutive 
calls to LL_stack_too_big (all stored per-thread). This seems to be a 
better solution (ie pypy does not segfault on any of Lib/test/crashers, 
particularly not on ones involving unevident C infinite loop). Yes, it 
has some performance penalty (hard to tell exactly what without trying).

Hum, this indeed might be not a best place to have such discussion, what 
about moving this to another, more general issue?

Cheers,
fijal

:.

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1881>
__________________________________


More information about the Python-bugs-list mailing list