Message176104
> I think the issue arises when the AST is built.
It's occurring when generating a code object from the AST, after the AST is built:
Python 3.3.0+ (3.3:bf1bf3bf3fe2, Nov 22 2012, 10:45:24)
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> code = "el".join(['if False: pass\n']*10000)
>>> import ast
>>> tree = ast.parse(code)
>>> code_obj = compile(tree, 'noname.py', 'exec')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
RuntimeError: maximum recursion depth exceeded during compilation
I don't know why you're getting a segfault rather than the above RuntimeError, though: on my machine this goes straight from working to the RuntimeError:
>>> code = "el".join(['if False: pass\n']*2996)
>>> code_obj = compile(ast.parse(code), 'noname.py', 'exec')
>>> code = "el".join(['if False: pass\n']*2997)
>>> code_obj = compile(ast.parse(code), 'noname.py', 'exec')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
RuntimeError: maximum recursion depth exceeded during compilation
Crys: do you still see the segfault if COMPILER_STACK_FRAME_SCALE is #define'd to be 2 rather than 3? |
|
Date |
User |
Action |
Args |
2012-11-22 10:53:45 | mark.dickinson | set | recipients:
+ mark.dickinson, lemburg, jcea, christian.heimes, benjamin.peterson, alexis.d |
2012-11-22 10:53:45 | mark.dickinson | set | messageid: <1353581625.88.0.294187320881.issue16527@psf.upfronthosting.co.za> |
2012-11-22 10:53:45 | mark.dickinson | link | issue16527 messages |
2012-11-22 10:53:45 | mark.dickinson | create | |
|