Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

abort when jumping out of a loop #67237

Closed
xdegaye mannequin opened this issue Dec 13, 2014 · 4 comments
Closed

abort when jumping out of a loop #67237

xdegaye mannequin opened this issue Dec 13, 2014 · 4 comments
Assignees
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-crash A hard crash of the interpreter, possibly with a core dump

Comments

@xdegaye
Copy link
Mannequin

xdegaye mannequin commented Dec 13, 2014

BPO 23048
Nosy @rhettinger, @benjaminp, @xdegaye

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/benjaminp'
closed_at = <Date 2014-12-13.21:08:30.513>
created_at = <Date 2014-12-13.11:34:33.197>
labels = ['interpreter-core', 'type-crash']
title = 'abort when jumping out of a loop'
updated_at = <Date 2014-12-14.10:15:18.481>
user = 'https://github.com/xdegaye'

bugs.python.org fields:

activity = <Date 2014-12-14.10:15:18.481>
actor = 'xdegaye'
assignee = 'benjamin.peterson'
closed = True
closed_date = <Date 2014-12-13.21:08:30.513>
closer = 'python-dev'
components = ['Interpreter Core']
creation = <Date 2014-12-13.11:34:33.197>
creator = 'xdegaye'
dependencies = []
files = []
hgrepos = []
issue_num = 23048
keywords = []
message_count = 4.0
messages = ['232604', '232614', '232622', '232635']
nosy_count = 4.0
nosy_names = ['rhettinger', 'benjamin.peterson', 'xdegaye', 'python-dev']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'crash'
url = 'https://bugs.python.org/issue23048'
versions = ['Python 3.5']

@xdegaye
Copy link
Mannequin Author

xdegaye mannequin commented Dec 13, 2014

With the following jump.py script:
def foo():
import pdb; pdb.set_trace()
while 1:
pass
return # this is line 5

foo()

The following debugging session aborts on Python 3.5.0a0 (default:334c01aa7f93, Dec 3 2014, 16:20:19):
$ python jump.py

/tmp/test/jump.py(3)foo()
-> while 1:
(Pdb) next
/tmp/test/jump.py(4)foo()
-> pass
(Pdb) jump 5
python: Objects/frameobject.c:258: frame_setlineno: Assertion `blockstack_top == 0' failed.
Aborted (core dumped)

@xdegaye xdegaye mannequin added interpreter-core (Objects, Python, Grammar, and Parser dirs) type-crash A hard crash of the interpreter, possibly with a core dump labels Dec 13, 2014
@rhettinger
Copy link
Contributor

Building on OS X 10.10 with the head of the code tree (as of today), I cannot reproduce this. Also the disassembly looks fine:

$ python3.5 jump.py 
> /Users/raymond/tmp/jump.py(3)foo()
-> while 1:
(Pdb) next
> /Users/raymond/tmp/jump.py(4)foo()
-> pass
(Pdb) jump 5
> /Users/raymond/tmp/jump.py(5)foo()
-> return # this is line 5
(Pdb) list
  1  	def foo():
  2  	    import pdb; pdb.set_trace()
  3  	    while 1:
  4  	        pass
  5  ->	    return # this is line 5
  6  	
  7  	foo()
  8  	
[EOF]
(Pdb) !from dis import dis
(Pdb) !dis(foo)
  2           0 LOAD_CONST               1 (0)
              3 LOAD_CONST               0 (None)
              6 IMPORT_NAME              0 (pdb)
              9 STORE_FAST               0 (pdb)
             12 LOAD_FAST                0 (pdb)
             15 LOAD_ATTR                1 (set_trace)
             18 CALL_FUNCTION            0 (0 positional, 0 keyword pair)
             21 POP_TOP

3 22 SETUP_LOOP 3 (to 28)

4 >> 25 JUMP_ABSOLUTE 25

5 >> 28 LOAD_CONST 0 (None)
31 RETURN_VALUE
(Pdb) !import sys
(Pdb) p sys.version_info
sys.version_info(major=3, minor=5, micro=0, releaselevel='alpha', serial=0)

@benjaminp benjaminp self-assigned this Dec 13, 2014
@python-dev
Copy link
Mannequin

python-dev mannequin commented Dec 13, 2014

New changeset 09f938915c6f by Benjamin Peterson in branch '3.4':
pop the loop block even for infinite while loops (closes bpo-23048)
https://hg.python.org/cpython/rev/09f938915c6f

New changeset baa5258bef22 by Benjamin Peterson in branch '2.7':
pop the loop block even for infinite while loops (closes bpo-23048)
https://hg.python.org/cpython/rev/baa5258bef22

New changeset ec96ffa6aa95 by Benjamin Peterson in branch 'default':
merge 3.4 (bpo-23048)
https://hg.python.org/cpython/rev/ec96ffa6aa95

@python-dev python-dev mannequin closed this as completed Dec 13, 2014
@xdegaye
Copy link
Mannequin Author

xdegaye mannequin commented Dec 14, 2014

Building on OS X 10.10 with the head of the code tree (as of today), I cannot reproduce this. Also the disassembly looks fine:

I should have mentionned that I am running a debug build of python.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-crash A hard crash of the interpreter, possibly with a core dump
Projects
None yet
Development

No branches or pull requests

2 participants