Skip to content

Crash because of ownership assert in PyObject_ClearManagedDict #152254

Description

@sobolevn

Crash report

Refs #151763
Original description: https://gist.github.com/devdanzin/99b84915b197ae0ade7face262b8af66

Repro:

fromunittest.mockimportMagicMockfrom_testcapiimportset_nomemoryset_nomemory(200) # fail allocations from the 200th onward (lands in shutdown GC)
(MagicMock(), undefined_name) # build a MagicMock (managed __dict__), then NameError abandons# it into a traceback cycle -> survives to shutdown GC

I have a fix ready.

Linked PRs

Metadata

Metadata

Assignees

Labels

interpreter-core(Objects, Python, Grammar, and Parser dirs)type-crashA hard crash of the interpreter, possibly with a core dump

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions