bpo-32604: Fix reference leak in select module#20600
bpo-32604: Fix reference leak in select module#20600vstinner merged 1 commit intopython:masterfrom vstinner:fix_select_leak
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? |
nanjekyejoannah
left a comment
There was a problem hiding this comment.
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.
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).
https://bugs.python.org/issue32604