[issue5765] stack overflow evaluating eval(() * 30000)

2012-11-23 Thread Jesús Cea Avión
Changes by Jesús Cea Avión j...@jcea.es: -- nosy: +jcea ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5765 ___ ___ Python-bugs-list mailing list

[issue5765] stack overflow evaluating eval(() * 30000)

2012-11-04 Thread Nick Coghlan
Nick Coghlan added the comment: We want to minimise the risk of breaking working code. Making it easy to adjust this recursion limit separately from the main recursion limit by using a scaling factor is a good way to do that. It shouldn't increase the maintenance burden in any significant

[issue5765] stack overflow evaluating eval(() * 30000)

2012-11-04 Thread Antoine Pitrou
Antoine Pitrou added the comment: Autogenerated code could easily hit the 1000 term limit - if anything, I'd be inclined to set it *higher* than 4 rather than lower, as breaking previously working code in a maintenance release is a bad thing, regardless of our opinion of the sanity of that

[issue5765] stack overflow evaluating eval(() * 30000)

2012-11-04 Thread Roundup Robot
Roundup Robot added the comment: New changeset ab02cd145f56 by Nick Coghlan in branch '3.3': Issue #5765: Apply a hard recursion limit in the compiler http://hg.python.org/cpython/rev/ab02cd145f56 New changeset bd1db93d76e1 by Nick Coghlan in branch 'default': Issue #5765: Merge from 3.3

[issue5765] stack overflow evaluating eval(() * 30000)

2012-11-04 Thread Nick Coghlan
Nick Coghlan added the comment: You can take the scaling factor out if you really want, but it adds no real maintenance overhead, and better reflects the real stack usage. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5765

[issue5765] stack overflow evaluating eval(() * 30000)

2012-11-04 Thread Nick Coghlan
Nick Coghlan added the comment: However, agreed on the won't fix for 3.2 and 2.7, although I'd consider it at least for 2.7 if someone went through and worked out a patch that applies cleanly. For 3.2, this really isn't the kind of thing we'd want to do in the final regular maintenance

[issue5765] stack overflow evaluating eval(() * 30000)

2012-11-04 Thread Antoine Pitrou
Antoine Pitrou added the comment: You can take the scaling factor out if you really want, but it adds no real maintenance overhead, and better reflects the real stack usage. Can you also add a related snippet in Tools/scripts/find_recursionlimit.py ? --

[issue5765] stack overflow evaluating eval(() * 30000)

2012-11-04 Thread Nick Coghlan
Nick Coghlan added the comment: Note: if you do take the scaling factor out, don't forget to track down the reasons behind the original commit that added the test that broke *without* the scaling factor. For me, the test suite fails without it is reason enough for me to say its needed -

[issue5765] stack overflow evaluating eval(() * 30000)

2012-11-04 Thread Roundup Robot
Roundup Robot added the comment: New changeset cf2515d0328b by Nick Coghlan in branch '3.3': Issue #5765: Also check the compiler when finding the recursion limit http://hg.python.org/cpython/rev/cf2515d0328b New changeset 3712028a0c34 by Nick Coghlan in branch 'default': Issue #5765: Merge

[issue5765] stack overflow evaluating eval(() * 30000)

2012-11-04 Thread Nick Coghlan
Nick Coghlan added the comment: The sanity check in the recursion limit finding script is definitely a good idea, so I added that (as the commits show). For the record, running that script on the 3.3 branch with my 4 GB RAM Fedora 17 ASUS Zenbook finds a maximum recursion limit around 16800,

[issue5765] stack overflow evaluating eval(() * 30000)

2012-11-04 Thread Mark Shannon
Mark Shannon added the comment: I don't think there is any need for a scaling factor. Expressions in auto-generated trees will tend to be trees of binary operator rather lists of purely unary operators. A tree of a billion items only has a depth of ~30. There is no way an expression tree 1000

[issue5765] stack overflow evaluating eval(() * 30000)

2012-11-04 Thread Antoine Pitrou
Antoine Pitrou added the comment: The sanity check in the recursion limit finding script is definitely a good idea, so I added that (as the commits show). Didn't you make a mistake in the recursion factor there? Or is it really 10 rather than 3? --

[issue5765] stack overflow evaluating eval(() * 30000)

2012-11-04 Thread Nick Coghlan
Nick Coghlan added the comment: Antoine: The scaling is deliberate higher in the recursion limit finder because we just want to ensure it hits the recursion limit (or blows the stack, if the scaling is wrong). In the tests, I cut it finer because I wanted to ensure we were straddling the

[issue5765] stack overflow evaluating eval(() * 30000)

2012-08-20 Thread Andrea Griffini
Andrea Griffini added the comment: I missed all the macrology present :-( ... the following is a patch that takes it into account (also defines a VISIT_QUIT macro to make more visible the exit points). The handling has been also extended to visit_stmt because the macros are shared. Of course

[issue5765] stack overflow evaluating eval(() * 30000)

2012-08-20 Thread Andrea Griffini
Andrea Griffini added the comment: On Mon, Aug 20, 2012 at 12:27 AM, Antoine Pitrou rep...@bugs.python.org wrote: Indeed I don't like the introduction of COMPILER_STACK_FRAME_SCALE. Re-using the existing infrastructure would be much easier to maintain. The default recursion limit is 1000,

[issue5765] stack overflow evaluating eval(() * 30000)

2012-08-19 Thread Francisco Martín Brugué
Francisco Martín Brugué added the comment: Just curiosity: how relate the magic numbers 10 and 2000 in test_compiler_recursion_limit to recursion_depth and recursion_limit Thanks! -- nosy: +francismb ___ Python tracker rep...@bugs.python.org

[issue5765] stack overflow evaluating eval(() * 30000)

2012-08-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: Indeed I don't like the introduction of COMPILER_STACK_FRAME_SCALE. Re-using the existing infrastructure would be much easier to maintain. The default recursion limit is 1000, which should cover any non-pathological code, IMHO. -- nosy: +pitrou stage:

[issue5765] stack overflow evaluating eval(() * 30000)

2012-08-19 Thread Amaury Forgeot d'Arc
Changes by Amaury Forgeot d'Arc amaur...@gmail.com: Added file: http://bugs.python.org/file26903/compiler_recursion_limit_check-2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5765 ___

[issue5765] stack overflow evaluating eval(() * 30000)

2012-08-19 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: The patch is incomplete: the VISIT macro contains a return 0; and in this case st-recursion_depth is not decremented. OTOH errors are never caught, so it's not necessary to do any cleanup in case of errors. Here is a simplified patch. --

[issue5765] stack overflow evaluating eval(() * 30000)

2012-08-17 Thread Mark Shannon
Mark Shannon added the comment: I've re-reviewed Andrea's patch (I was looking over Andrea's shoulder at the EuroPython sprint when he wrote it). It looks good and applies cleanly. Could someone commit it please. -- nosy: +Mark.Shannon ___ Python

[issue5765] stack overflow evaluating eval(() * 30000)

2012-07-07 Thread Andrea Griffini
Andrea Griffini agr...@tin.it added the comment: This is a fix for this issue. The solution was to add two fields (recursion_depth and recursion_limit) to the symbol table object and just increment and check the depth in symtable_visit_expr raising a RuntimeError in case the limit is exceeded.

[issue5765] stack overflow evaluating eval(() * 30000)

2012-06-28 Thread Serhiy Storchaka
Serhiy Storchaka storch...@gmail.com added the comment: Terry, try a large constant. I can reproduce it on all versions from 2.6 to 3.3 with eval(() * 30). -- nosy: +storchaka versions: +Python 2.6, Python 3.1, Python 3.2, Python 3.3, Python 3.4

[issue5765] stack overflow evaluating eval(() * 30000)

2012-06-28 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu added the comment: In 3.3.3a4 and b1, with original 3, I no longer get TypeError, but box python(w).exe has stopped working. So either Win7, 64 bit, on machine with much more memory makes a diffence, or something in code reverted. Is this really a security

[issue5765] stack overflow evaluating eval(() * 30000)

2012-06-28 Thread Serhiy Storchaka
Serhiy Storchaka storch...@gmail.com added the comment: I don't think that eval is used in security context. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5765 ___

[issue5765] stack overflow evaluating eval(() * 30000)

2010-08-04 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu added the comment: On 3.1.2, WinXP, I immediately get TypeError: 'tuple' object is not callable so this seems to have been fixed for 3.x. If released 2.7 is ok, we can close this. -- nosy: +terry.reedy versions: -Python 2.5, Python 2.6, Python 3.0

[issue5765] stack overflow evaluating eval(() * 30000)

2009-04-15 Thread Gabriel Genellina
New submission from Gabriel Genellina gagsl-...@yahoo.com.ar: Originally reported by Juanjo Conti at PyAr: http://blog.gmane.org/gmane.org.user-groups.python.argentina/ day=20090415 Evaluating this expression causes a stack overflow, and the Python interpreter exits abnormally: eval(() *

[issue5765] stack overflow evaluating eval(() * 30000)

2009-04-15 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: This is a pathological case. I suppose we have to add a recursion counter to the compiler struct. -- nosy: +benjamin.peterson priority: - low ___ Python tracker rep...@bugs.python.org