Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

__file__ for Some Dynamic Extension Modules has a Broken Refcount #118733

Open
ericsnowcurrently opened this issue May 7, 2024 · 0 comments
Open
Labels
3.13 bugs and security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error

Comments

@ericsnowcurrently
Copy link
Member

ericsnowcurrently commented May 7, 2024

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

@ericsnowcurrently ericsnowcurrently added type-bug An unexpected behavior, bug, or error interpreter-core (Objects, Python, Grammar, and Parser dirs) 3.13 bugs and security fixes labels May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.13 bugs and security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error
1 participant