Xinmeng Xia <xi...@smail.nju.edu.cn> added the comment:

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

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue43664>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to