This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark.dickinson
Recipients alexis.d, benjamin.peterson, christian.heimes, jcea, lemburg, mark.dickinson
Date 2012-11-22.10:53:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1353581625.88.0.294187320881.issue16527@psf.upfronthosting.co.za>
In-reply-to
Content
> 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?
History
Date User Action Args
2012-11-22 10:53:45mark.dickinsonsetrecipients: + mark.dickinson, lemburg, jcea, christian.heimes, benjamin.peterson, alexis.d
2012-11-22 10:53:45mark.dickinsonsetmessageid: <1353581625.88.0.294187320881.issue16527@psf.upfronthosting.co.za>
2012-11-22 10:53:45mark.dickinsonlinkissue16527 messages
2012-11-22 10:53:45mark.dickinsoncreate