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.

classification
Title: Crash after modifying f_lineno
Type: crash Stage: resolved
Components: Interpreter Core Versions: Python 3.3, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: benjamin.peterson Nosy List: benjamin.peterson, georg.brandl, mtomassoli, peter.otten, python-dev, r.david.murray
Priority: normal Keywords: patch

Created on 2012-04-18 11:20 by mtomassoli, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
script.py mtomassoli, 2012-04-18 11:20
frame_setlineno.patch peter.otten, 2012-04-18 13:37 review
Messages (4)
msg158603 - (view) Author: Massimiliano Tomassoli (mtomassoli) Date: 2012-04-18 11:20
Debugging script.py and jumping to line 3 makes Python crash.
For instance:

python -m pdb script.py
(Pdb) j 3
msg158613 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2012-04-18 12:51
For reference, here is the crash:

rdmurray@hey:~/python/p33>./python -m pdb  script.py
> /home/rdmurray/python/p33/script.py(1)<module>()
-> with open('test') as f:
(Pdb) j 3
python: Objects/frameobject.c:207: frame_setlineno: Assertion `blockstack_top > 0' failed.
zsh: abort      ./python -m pdb script.py
msg158619 - (view) Author: Peter Otten (peter.otten) * Date: 2012-04-18 13:37
frame_setlineno() doesn't keep track of with blocks. Here's a patch.
msg158634 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-04-18 15:24
New changeset 6a0a073e8461 by Benjamin Peterson in branch '3.2':
SETUP_WITH acts like SETUP_FINALLY for the purposes of setting f_lineno (closes #14612)
http://hg.python.org/cpython/rev/6a0a073e8461

New changeset 0695f5d028a7 by Benjamin Peterson in branch 'default':
merge 3.2 (#14612)
http://hg.python.org/cpython/rev/0695f5d028a7

New changeset 67be12ab8948 by Benjamin Peterson in branch '2.7':
SETUP_WITH acts like SETUP_FINALLY for the purposes of setting f_lineno (closes #14612)
http://hg.python.org/cpython/rev/67be12ab8948
History
Date User Action Args
2022-04-11 14:57:29adminsetgithub: 58817
2012-04-18 15:24:40python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg158634

resolution: fixed
stage: resolved
2012-04-18 13:37:14peter.ottensetfiles: + frame_setlineno.patch

nosy: + peter.otten
messages: + msg158619

keywords: + patch
2012-04-18 13:07:09benjamin.petersonsetassignee: benjamin.peterson

nosy: + benjamin.peterson
2012-04-18 12:51:12r.david.murraysetnosy: + r.david.murray
messages: + msg158613
2012-04-18 11:23:05pitrousetnosy: + georg.brandl
2012-04-18 11:22:27mtomassolisettype: crash
2012-04-18 11:20:31mtomassolicreate