Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

bpo-38858: Fix ref leak in pycore_interp_init()#17512

Merged
vstinner merged 1 commit into
python:masterpython/cpython:masterfrom
vstinner:fix_sys_createCopy head branch name to clipboard
Dec 8, 2019
Merged

bpo-38858: Fix ref leak in pycore_interp_init()#17512
vstinner merged 1 commit into
python:masterpython/cpython:masterfrom
vstinner:fix_sys_createCopy head branch name to clipboard

Conversation

@vstinner

@vstinner vstinner commented Dec 8, 2019

Copy link
Copy Markdown
Member

bpo-38858, bpo-38997: _PySys_Create() returns a strong reference to
the sys module: Py_DECREF() is needed when we are done with the
module.

https://bugs.python.org/issue38858

@vstinner

vstinner commented Dec 8, 2019

Copy link
Copy Markdown
Member Author

I tested manually that this change fix https://bugs.python.org/issue38997:

$ ./python -m test -R 3:3 -j0  test__xxsubinterpreters test_atexit test_capi test_threading
(...)
All 4 tests OK.

Total duration: 1 min 2 sec
Tests result: SUCCESS

This bug is not a regression: it exists at least since Python 2.7. It's just that previously, the bug was hidden because subinterpreters were not well isolated from the main interpreter.

@ericsnowcurrently: Welcome to the hell of correctness enforced by subinterpreters :-)

bpo-38858, bpo-38997: _PySys_Create() returns a strong reference to
the sys module: Py_DECREF() is needed when we are done with the
module.
@vstinner

vstinner commented Dec 8, 2019

Copy link
Copy Markdown
Member Author

If this change is merged, PR #17509 can be rejected.

@vstinner vstinner merged commit 080ee5a into python:master Dec 8, 2019
@vstinner vstinner deleted the fix_sys_create branch December 8, 2019 20:56
shihai1991 pushed a commit to shihai1991/cpython that referenced this pull request Jan 31, 2020
bpo-38858, bpo-38997: _PySys_Create() returns a strong reference to
the sys module: Py_DECREF() is needed when we are done with the
module.
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.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.