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

bpo-45160: Fix refleak in test_ttk_guionly introduced in GH-28291 #29416

Merged
merged 1 commit into from Nov 5, 2021

Conversation

ambv
Copy link
Contributor

@ambv ambv commented Nov 4, 2021

The closure in cb_test was the root cause of the refleak, to address it we're taking the callback handle and deleting it when we don't need it anymore. Additionally, other tests explicitly destroy OptionMenu objects to avoid issues with reference cycles.

Before the change

0:00:00 load avg: 4.23 Run tests sequentially
0:00:00 load avg: 4.23 [1/1] test_ttk_guionly
beginning 9 repetitions
123456789
.........
test_ttk_guionly leaked [63, 63, 63, 63] references, sum=252
test_ttk_guionly leaked [31, 31, 31, 31] memory blocks, sum=124
test_ttk_guionly failed (reference leak)

== Tests result: FAILURE ==

After the change

0:00:00 load avg: 10.33 Run tests sequentially
0:00:00 load avg: 10.33 [1/1] test_ttk_guionly
beginning 9 repetitions
123456789
.........

== Tests result: SUCCESS ==

https://bugs.python.org/issue45160

@ambv
Copy link
Contributor Author

ambv commented Nov 5, 2021

Fix confirmed on the Windows 8.1 refleak buildbot:

0:36:09 load avg: 5.80 [146/425] test_imghdr passed -- running: test_io (5 min 9 sec), test_pickle (4 min 17 sec), test_nntplib (1 min)
beginning 6 repetitions
123456
......
0:36:28 load avg: 5.15 [147/425] test_ttk_guionly passed -- running: test_io (5 min 28 sec), test_pickle (4 min 36 sec), test_nntplib (1 min 19 sec)
beginning 6 repetitions
123456
......

Build link: https://buildbot.python.org/all/#/builders/443/builds/9

@ned-deily ned-deily assigned ambv and unassigned ned-deily Nov 5, 2021
@ambv ambv merged commit 54d1e3f into python:main Nov 5, 2021
11 checks passed
@miss-islington
Copy link
Contributor

miss-islington commented Nov 5, 2021

Thanks @ambv for the PR 🌮🎉.. I'm working now to backport this PR to: 3.9, 3.10.
🐍🍒🤖

@miss-islington
Copy link
Contributor

miss-islington commented Nov 5, 2021

Sorry @ambv, I had trouble checking out the 3.10 backport branch.
Please backport using cherry_picker on command line.
cherry_picker 54d1e3f72ed1ad8e860888c30ee7a285b931c0d1 3.10

@ambv ambv deleted the fix-refleak-ttk branch Nov 5, 2021
@bedevere-bot
Copy link

bedevere-bot commented Nov 5, 2021

GH-29420 is a backport of this pull request to the 3.9 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 5, 2021
… (pythonGH-29416)

(cherry picked from commit 54d1e3f)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
@miss-islington
Copy link
Contributor

miss-islington commented Nov 5, 2021

Thanks @ambv for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10.
🐍🍒🤖

@miss-islington
Copy link
Contributor

miss-islington commented Nov 5, 2021

Thanks @ambv for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10.
🐍🍒🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 5, 2021
… (pythonGH-29416)

(cherry picked from commit 54d1e3f)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
ambv added a commit that referenced this pull request Nov 5, 2021
…-29416) (GH-29420)

(cherry picked from commit 54d1e3f)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
ambv added a commit that referenced this pull request Nov 5, 2021
…-29416) (GH-29421)

(cherry picked from commit 54d1e3f)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants