[issue1881] increase parser stack limit

2008-02-23 Thread Christian Heimes
Christian Heimes added the comment: For the record: I had to decrease the level to 93. The test in test_parser didn't pass with 99 levels. __ Tracker <[EMAIL PROTECTED]> __

[issue1881] increase parser stack limit

2008-02-23 Thread Facundo Batista
Facundo Batista added the comment: Applied in r60974. Maciek, please push that alternative way of handling this limit on python-dev, that could lead to a better handling in the future. But, so far, we have a limit a little upper, and tested. Thank you all! -- resolution: -> accepted

[issue1881] increase parser stack limit

2008-02-07 Thread Ralf Schmitt
Ralf Schmitt added the comment: when I set the the stack size to 128kb on a 64bit linux with ulimit -s 128, the tests still pass (default stack size is 8192 kb). However the following fails at recursion level 180 with a segfault: def f(count): print count f(count+1) f(0) If I set the st

[issue1881] increase parser stack limit

2008-01-22 Thread Christian Heimes
Christian Heimes added the comment: Maciek Fijalkowski wrote: > Hum, this indeed might be not a best place to have such discussion, what > about moving this to another, more general issue? Ah! :) It took me a while to understand your intention but now I get you! The python-dev mailing list is p

[issue1881] increase parser stack limit

2008-01-22 Thread Maciek Fijalkowski
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 r

[issue1881] increase parser stack limit

2008-01-22 Thread Christian Heimes
Christian Heimes added the comment: Maciek Fijalkowski wrote: > Wuaaa, sorry > > Added file: http://bugs.python.org/file9259/stack.h Can you provide a working patch, please? The file doesn't explain how it should be plugged into the parser. What's the license of the file? We can't just add code

[issue1881] increase parser stack limit

2008-01-22 Thread Maciek Fijalkowski
Maciek Fijalkowski added the comment: Wuaaa, sorry Added file: http://bugs.python.org/file9259/stack.h __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs

[issue1881] increase parser stack limit

2008-01-22 Thread Christian Heimes
Christian Heimes added the comment: Maciek Fijalkowski wrote: > Maciek Fijalkowski added the comment: > > Attached file that handles stack overflow slightly better (from pypy). > It really measures stack size, not some arbitrary limit of python calls. > Yes, this have slightly bigger overhead th

[issue1881] increase parser stack limit

2008-01-22 Thread Maciek Fijalkowski
Maciek Fijalkowski added the comment: Attached file that handles stack overflow slightly better (from pypy). It really measures stack size, not some arbitrary limit of python calls. Yes, this have slightly bigger overhead than just passing around number, but as a side effect solves Lib/test/crash

[issue1881] increase parser stack limit

2008-01-22 Thread Ralf Schmitt
Ralf Schmitt added the comment: one more. this program seems to leak memory: x=1000 e="["*x+"]"*x while 1: try: eval(e) except MemoryError: pass __ Tracker <[EMAIL PROTECTED]>

[issue1881] increase parser stack limit

2008-01-22 Thread Ralf Schmitt
Ralf Schmitt added the comment: yes, here it is. I've added the tests to Lib/test/test_parser. BTW, is it possible to trigger a segfault by constructing a parser.st object and calling compile on it? Added file: http://bugs.python.org/file9258/up-maxstack+tests.txt __

[issue1881] increase parser stack limit

2008-01-21 Thread Facundo Batista
Facundo Batista added the comment: Ralf, could you please submit the unit test that Guido suggested? Please change also the 10x to 3x. We could then apply this, :) Thank you very much! -- nosy: +facundobatista __ Tracker <[EMAIL PROTECTED]>

[issue1881] increase parser stack limit

2008-01-21 Thread Guido van Rossum
Guido van Rossum added the comment: I don't know what common stack sizes are any more. Even on the same platform, the main thread may have a different stack size than other threads. Would it make sense to make this limit more platform-dependent? I guess really good would be a way to handle C

[issue1881] increase parser stack limit

2008-01-21 Thread Christian Heimes
Christian Heimes added the comment: 10-fold is very progressive. Let's be a bit more conservative for platforms with a small stack size (e.g. *BSD and mobile phones). A parser stack limit of about 1500 would still allow roughly 100 deeply nested lists. -- nosy: +tiran priority: -> norma

[issue1881] increase parser stack limit

2008-01-21 Thread Georg Brandl
Georg Brandl added the comment: Guido, is the 10-fold increase okay? -- assignee: -> gvanrossum nosy: +georg.brandl, gvanrossum __ Tracker <[EMAIL PROTECTED]> __ _

[issue1881] increase parser stack limit

2008-01-21 Thread Ralf Schmitt
Changes by Ralf Schmitt: -- versions: +Python 2.6 Added file: http://bugs.python.org/file9249/up-maxstack.txt __ Tracker <[EMAIL PROTECTED]> __

[issue1881] increase parser stack limit

2008-01-21 Thread Ralf Schmitt
New submission from Ralf Schmitt: The parser can handle nested structures only up to a certain limit. The limit is currently reached around 33 deeply nested lists, which is a bit too low. This patch increases that limit by a factor of 10. see http://bugs.python.org/issue21 for further discu