Skip to content

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

Merged
vstinner merged 1 commit into
python:masterfrom
pablogsal:bpo36447
Mar 27, 2019
Merged

bpo-36447: Fix refleak in sysmodule.c when calling SET_SYS_FROM_STRING_BORROW#12586
vstinner merged 1 commit into
python:masterfrom
pablogsal:bpo36447

Conversation

@pablogsal
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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