Skip to content

Crash when inspecting frame of generator #94262

Description

@kumaraditya303

Crash report

This was discovered in an asyncio program when interrupted with CTRL - C.
Minimal Reproducer:

importgcimportinspectgc.set_threshold(1, 0, 0)
f= []
defcb(*args):
f.append(inspect.stack())
gc.callbacks.append(cb)
defgen():
yield1g=gen()
g.__next__()

Error messages

python: Python/ceval.c:5436: _PyEval_EvalFrameDefault: Assertion `frame->frame_obj == NULL' failed.Aborted (core dumped)

Your environment

  • CPython versions tested on: Python 3.12.0a0 51fd4de, Python 3.11.0b3+ 41e4b42
  • Operating system and architecture: Linux 5.4.0-1074-azure

cc @markshannon@pablogsal

Metadata

Metadata

Assignees

Labels

3.11only security fixesrelease-blockertype-crashA hard crash of the interpreter, possibly with a core dump

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions