Skip to content

_tkinter leaks type references on initialization #123504

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

Closed
ZeroIntensity opened this issue Aug 30, 2024 · 3 comments
Closed

_tkinter leaks type references on initialization #123504

ZeroIntensity opened this issue Aug 30, 2024 · 3 comments
Labels
extension-modules C modules in the Modules dir topic-tkinter type-bug An unexpected behavior, bug, or error

Comments

@ZeroIntensity
Copy link
Member

ZeroIntensity commented Aug 30, 2024

Bug report

Bug description:

Reproducer:

$ ./python -Xshowrefcount -c "import tkinter"

Seems to be caused by the use of AddObjectRef on a strong reference in the _tkinter initialization function, causing a double Py_INCREF.

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs

@serhiy-storchaka
Copy link
Member

#123505 was not correct. You need to:

  1. Restore m_size.
  2. Define m_travel.

@ZeroIntensity
Copy link
Member Author

I'll submit a PR within in the hour, sorry!

@serhiy-storchaka
Copy link
Member

It would also be nice if one of the subinterpreters experts would take a look at this change.

vstinner pushed a commit that referenced this issue Sep 4, 2024
* Add module traverse function to _tkinter.
* Set m_size to -1 (instead of 0).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension-modules C modules in the Modules dir topic-tkinter type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants