[issue43664] Long computations in pdb.run() lead to segfault

2021-04-06 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It is an old known issue, it is not specific to pdb, but happens with 
compile(), and it is not fixed yet.

>>> compile("+0"*100, '?', 'eval')
Segmentation fault (core dumped)

Stack overflow in recursive call of validate_expr() in at Python/ast.c:223.

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43664] Long computations in pdb.run() lead to segfault

2021-04-05 Thread Xinmeng Xia


Xinmeng Xia  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" * 100, "-", "exec")

Program received signal SIGSEGV, Segmentation fault.
0x0063aedc in astfold_expr (node_=0xf5707d0, ctx_=0x76282450, 
state=0x7fffd608) 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"*100)

Program received signal SIGSEGV, Segmentation fault.
0x0063ac8f in astfold_expr (node_=0xf59b810, ctx_=0x761f7c30, 
state=0x7fffd1c8) 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" * 100, "-", "exec")
Traceback (most recent call last):
  File "", line 1, in 
RecursionError: maximum recursion depth exceeded during compilation
>>> import pdb
>>> pdb.run("1+2"*100)
Traceback (most recent call last):
  File "", line 1, in 
  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, "", "exec")
RecursionError: maximum recursion depth exceeded during compilation

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43664] Long computations in pdb.run() lead to segfault

2021-04-02 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

This looks like a duplicate of https://bugs.python.org/issue42714 which has 
been fixed.

--
nosy: +xtreak

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43664] Long computations in pdb.run() lead to segfault

2021-04-02 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

```pdb.run(...)``` is ends up in ```bdb.Bdb.run```, which uses compile and exec 
to run the code.

And indeed:

>>> compile("1+2" * 100, "-", "exec")
zsh: segmentation fault  python3.9

--
components: +Interpreter Core
nosy: +ronaldoussoren

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43664] Long computations in pdb.run() lead to segfault

2021-03-29 Thread Xinmeng Xia


New submission from Xinmeng Xia :

Long computations in pdb.run() lead to interpreter crashes.

Crash example
===
Python 3.9.2 (default, Mar 12 2021, 15:08:35) 
[GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pdb
>>> pdb.run("1+2"*100)
Segmentation fault (core dumped)
===

Environment:
Ubuntu 16.04, Python 3.9.2, Python 3.10.0a6
Mac OS Big Sur 11.2.3, Python 3.91, Python 3.10.0a2

--
components: Library (Lib)
messages: 389789
nosy: xxm
priority: normal
severity: normal
status: open
title: Long computations in pdb.run() lead to segfault
type: crash
versions: Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com