Skip to content

bpo-36447: Fix refleak in sysmodule.c when calling SET_SYS_FROM_STRING_BORROW #12586

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

Merged
merged 1 commit into from
Mar 27, 2019

Conversation

pablogsal
Copy link
Member

@pablogsal pablogsal commented Mar 27, 2019

SET_SYS_FROM_STRING_BORROW calls PyDict_SetItemString and that increases the refcount of the xoptions dict.

https://bugs.python.org/issue36447

@vstinner
Copy link
Member

I confirm that the PR fix the leak:

$ ./python -m test -R 3:3 test__xxsubinterpreters
...
test__xxsubinterpreters leaked [138, 138, 138] references, sum=414
...
$ git pr 12586
$ git rebase master
$ make
$ ./python -m test -R 3:3 test__xxsubinterpreters
...
Tests result: SUCCESS

I really hate SET_SYS_FROM_STRING_BORROW macro, the name makes no sense :-(

@vstinner vstinner merged commit 34ef64f into python:master Mar 27, 2019
@vstinner
Copy link
Member

@pablogsal: Thanks, I merged your PR.

@pablogsal pablogsal deleted the bpo36447 branch March 27, 2019 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants