[pypy-dev] setrecursionlimit deprecation?

Paolo Giarrusso p.giarrusso at gmail.com
Sat Dec 11 21:49:29 CET 2010


On Sat, Dec 11, 2010 at 19:16, Antonio Cuni <anto.cuni at gmail.com> wrote:
> On 11/12/10 18:32, Armin Rigo wrote:
>
>> But then people are going to complain that their app seems to hang up
>> on pypy, and neither they nor we have any clue what is going on ---
>> until we figure out that they used sys.setrecursionlimit() to put a
>> bound on recursion and catch the RuntimeError.  That's at least the
>> reason for which I suggested that calling sys.setrecursionlimit()
>> should at least print a warning.  Now I agree that maybe the message
>> of the warning is not the clearest one.

> I was about to propose to change the message into something like
> "sys.setrecursionlimit is ignored by PyPy".  I think this is already an
> improvement over the current message, but has the drawback than then people
> will complain that pypy might run out of stack (which is false, but not
> apparent by the warning message).

Do you mean that the stack size on Python is not limited (which has
its problems for infinite-recursion bugs), or just that stack overflow
is handled gracefully by throwing an exception?

In the first case, I'd propose "stack size on PyPy cannot be limited"
(and maybe additionally "sys.setrecursionlimit is ignored by PyPy").
In the second case, I'd propose "recursion depth is only limited by
stack size". Maybe the call should try adjusting the stack size?

However, reading os_thread.py:stack_size() [1] suggests that the stack
size _is_ limited for a thread, so I guess you're in the second case.

[1] codespeak.net/pypy/dist/pypy/module/thread/os_thread.py

Best regards
-- 
Paolo Giarrusso - Ph.D. Student
http://www.informatik.uni-marburg.de/~pgiarrusso/



More information about the Pypy-dev mailing list