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 xxm
Recipients ronaldoussoren, xtreak, xxm
Date 2021-04-06.06:54:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1617692078.03.0.466048707597.issue43664@roundup.psfhosted.org>
In-reply-to
Content
pdb.run() seems crashing different positions of Python (Python/ast_opt.c:488 for pdb.run, Python/ast_opt.c:494 for compile()). But the commit 364d0d20f924071b749e5a889eca22628f4892a3, PR 23744, bpo-42609 for compile() also fix this bug in pdb.run(). Should we close this issue and mark it as fixed? 



$ gdb ./python
(gdb) run
Python 3.10.0a6 (default, Mar 19 2021, 11:45:56) [GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> compile("1+2" * 1000000, "-", "exec")

Program received signal SIGSEGV, Segmentation fault.
0x000000000063aedc in astfold_expr (node_=0xf5707d0, ctx_=0x7ffff6282450, 
    state=0x7fffffffd608) at Python/ast_opt.c:494
494	        CALL(astfold_expr, expr_ty, node_->v.BinOp.left);
(gdb) run
Python 3.10.0a6 (default, Mar 19 2021, 11:45:56) [GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pdb
>>> pdb.run("1+2"*1000000)

Program received signal SIGSEGV, Segmentation fault.
0x000000000063ac8f in astfold_expr (node_=0xf59b810, ctx_=0x7ffff61f7c30, 
    state=0x7fffffffd1c8) at Python/ast_opt.c:488
488	{
(gdb)


$gdb '/home/xxm/Downloads/cpython-364d0d20f924071b749e5a889eca22628f4892a3/python' 
(gdb) run
Python 3.10.0a3+ (default, Apr  6 2021, 11:24:27) 
[GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> compile("1+2" * 1000000, "-", "exec")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
RecursionError: maximum recursion depth exceeded during compilation
>>> import pdb
>>> pdb.run("1+2"*1000000)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/xxm/Downloads/cpython-364d0d20f924071b749e5a889eca22628f4892a3/Lib/pdb.py", line 1597, in run
    Pdb().run(statement, globals, locals)
  File "/home/xxm/Downloads/cpython-364d0d20f924071b749e5a889eca22628f4892a3/Lib/bdb.py", line 577, in run
    cmd = compile(cmd, "<string>", "exec")
RecursionError: maximum recursion depth exceeded during compilation
History
Date User Action Args
2021-04-06 06:54:38xxmsetrecipients: + xxm, ronaldoussoren, xtreak
2021-04-06 06:54:38xxmsetmessageid: <1617692078.03.0.466048707597.issue43664@roundup.psfhosted.org>
2021-04-06 06:54:38xxmlinkissue43664 messages
2021-04-06 06:54:37xxmcreate