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.

Title: Assertion failed in ceval.c
Type: crash Stage: resolved
Components: Interpreter Core Versions: Python 3.11
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Mark.Shannon Nosy List: Mark.Shannon, brandtbucher, erlendaasland, kumaraditya
Priority: release blocker Keywords:

Created on 2022-01-14 10:04 by kumaraditya, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (4)
msg410550 - (view) Author: Kumar Aditya (kumaraditya) * (Python triager) Date: 2022-01-14 10:06
The following code causes Assertion failed on Windows 11 

import cProfile
def test():
    import sys
    import dis

with cProfile.Profile() as p:


❯ ./python.bat 
Running Debug|x64 interpreter...
Assertion failed: frame->f_lasti >= 0, file D:\cpython\Python\ceval.c, line 6509
msg410551 - (view) Author: Kumar Aditya (kumaraditya) * (Python triager) Date: 2022-01-14 10:10
Tested commit is 7c770d3350813a82a639fcb3babae0de2b87aaae
msg410553 - (view) Author: Mark Shannon (Mark.Shannon) * (Python committer) Date: 2022-01-14 11:07
I can reproduce this on linux.

The problem is that when closing a generator that has not started, the frame may not be in a valid state (hence the assertion failure).

This should be fixed by implementing as that will ensure that the frame is in a valid state before the generator is created.

I'll make implementing a priority in order to fix this.
msg412174 - (view) Author: Erlend E. Aasland (erlendaasland) * (Python triager) Date: 2022-01-30 20:40
Did GH-30633 fix this? Is there further work to be done?
Date User Action Args
2022-04-11 14:59:54adminsetgithub: 90532
2022-03-07 12:13:28kumaradityasetstatus: pending -> closed
resolution: fixed
stage: resolved
2022-01-30 20:40:17erlendaaslandsetstatus: open -> pending
nosy: + erlendaasland
messages: + msg412174

2022-01-17 14:05:10Mark.Shannonsetpriority: normal -> release blocker
2022-01-14 11:07:57Mark.Shannonsetassignee: Mark.Shannon

messages: + msg410553
nosy: + brandtbucher
2022-01-14 10:14:02kumaradityasetnosy: + Mark.Shannon
2022-01-14 10:10:27kumaradityasetmessages: + msg410551
2022-01-14 10:06:30kumaradityasetmessages: + msg410550
2022-01-14 10:04:47kumaradityasetversions: + Python 3.11
2022-01-14 10:04:33kumaradityacreate