-
-
Notifications
You must be signed in to change notification settings - Fork 30.8k
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-32604: Fix reference leak in select module #20600
Conversation
Fix reference leak in PyInit_select() of the select module: remove Py_INCREF(poll_Type).
@corona10 @shihai1991: Would you mind to review this fix? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to see if, with this patch, I could solve the refleaks we have been discussing @vstinner on subinterpreters but I can still see the leaks. Am I missing something? Looks like you said you got a success on your end.
Which commit did you try? Did you rebase the commit? I used the commit 9d17cbf. |
I have run your test in my vm, it have been fixed, thanks. $ ./python -m test -R 3:3 test_subinterpreters == Tests result: SUCCESS == 1 test OK. Total duration: 465 ms |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well I 've run the test code on my local and I detect the current master branch is leaked
and this PR fixes the issue.
def test_bpo_32604(self):
code = f"""import select
a = select.poll()
"""
ret = test.support.run_in_subinterp(code)
self.assertEqual(ret, 0)
Thanks for the work @vstinner
I talked to Joannah in private and she just used the wrong command to test the fix :-)
Thanks for this nice manual test! |
Yes, I confirmed with the correct command and this fixes the leak. Thanks @vstinner |
Fix reference leak in PyInit_select() of the select module: remove Py_INCREF(poll_Type).
Fix reference leak in PyInit_select() of the select module:
remove Py_INCREF(poll_Type).
https://bugs.python.org/issue32604