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: Debugger jumps to a wrong instruction in for loop
Type: Stage:
Components: Versions: Python 3.10
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Mark.Shannon, brandtbucher, franarenasafan, veky
Priority: normal Keywords:

Created on 2022-03-03 10:20 by franarenasafan, last changed 2022-04-11 14:59 by admin.

Messages (3)
msg414417 - (view) Author: Francisco Arenas Afán de Rivera (franarenasafan) Date: 2022-03-03 10:20
I found that the debugger doesn't follow the normal program order when executing a foor loop with more than 3 instructions inside and one loop.

code example:

a = 0
b = 0
c = 0
for i in range(1):
    a += 1
    b += 1 # Set breakpoint here
    c += 1 # Also crash with breakpoint here

jumps to the line b += 1 after the end of the loop and crashes with error: Process finished with exit code -1073741819 (0xC0000005)
msg414450 - (view) Author: Mark Shannon (Mark.Shannon) * (Python committer) Date: 2022-03-03 15:19
Which debugger? Which version of Python?

Please provide all the steps required to reproduce, otherwise there is little we can do.
msg414460 - (view) Author: Vedran Čačić (veky) * Date: 2022-03-03 19:03
pdb on Py3.10.2 works fine with that code.
History
Date User Action Args
2022-04-11 14:59:56adminsetgithub: 91064
2022-03-03 19:03:33vekysetnosy: + veky
messages: + msg414460
2022-03-03 18:57:56brandtbuchersetnosy: + brandtbucher
2022-03-03 15:19:25Mark.Shannonsetnosy: + Mark.Shannon
messages: + msg414450
2022-03-03 10:20:54franarenasafancreate