__file__ for Some Dynamic Extension Modules has a Broken Refcount #118733
Labels
3.13
bugs and security fixes
interpreter-core
(Objects, Python, Grammar, and Parser dirs)
type-bug
An unexpected behavior, bug, or error
Bug report
Bug description:
In gh-118532 I was getting crashes when the _testsinglephase module's cached copy of
__dict__
was finalized. I worked around it in that PR by doing an unconditional incref, but that introduced a refleak for other cases. At the time, I wasn't able to determine if gh-118532 was the source of the refcount problem or if it only exposed an existing problem.While working on gh-118157 I narrowed the problem down to the
__file__
value in the cached__dict__
and resolved it by interning the string. However, the underlying problem remains: somewhere along the line there seems to be a missing incref.That needs to be located and fixed, and then the interning can be dropped.
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
The text was updated successfully, but these errors were encountered: