This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2017年09月11日 16:29 by vstinner, last changed 2022年04月11日 14:58 by admin. This issue is now closed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 3506 | merged | eric.snow, 2017年09月11日 22:54 | |
| PR 3567 | merged | eric.snow, 2017年09月14日 07:15 | |
| Messages (8) | |||
|---|---|---|---|
| msg301882 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2017年09月11日 16:29 | |
The following commands show memory leaks introduced by bpo-30860: $ ./python -m test -R 3:3 test_atexit -m test.test_atexit.SubinterpreterTest.test_callbacks_leak $ ./python -m test -R 3:3 test_atexit -m test.test_atexit.SubinterpreterTest.test_callbacks_leak_refcycle $ ./python -m test -R 3:3 test_threading -m test.test_threading.SubinterpThreadingTests.test_threads_join $ ./python -m test -R 3:3 test_capi -m test.test_capi.SubinterpreterTest.test_subinterps |
|||
| msg301883 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2017年09月11日 16:30 | |
> The following commands show memory leaks introduced by bpo-30860: Oh, I'm talking about the commit 2ebc5ce42a8a9e047e790aefbf9a94811569b2b6. |
|||
| msg301886 - (view) | Author: Stefan Krah (skrah) * (Python committer) | Date: 2017年09月11日 16:36 | |
Could be the same as #31408. |
|||
| msg301889 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2017年09月11日 17:14 | |
The leak comes from the following lines of _PySys_EndInit():
---
PyObject *warnoptions = get_warnoptions();
if (warnoptions == NULL)
return -1;
SET_SYS_FROM_STRING_BORROW_INT_RESULT("warnoptions", warnoptions);
PyObject *xoptions = get_xoptions();
if (xoptions == NULL)
return -1;
SET_SYS_FROM_STRING_BORROW_INT_RESULT("_xoptions", xoptions);
---
It's not the first time that I have an issue with these attributes. The last reference weak caused by multiple interpreters was also related to this one if I recall correctly.
See bpo-30598 and my commit 865de27dd79571a4a5c7a7d22a07fb909c4a9f8e.
|
|||
| msg301891 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2017年09月11日 17:16 | |
Extract of my msg295399: "The problem is that warnoptions is stored in a C global variable *and* in sys.warnoptions of each interpreter. The ownership of this variable is unclear." Maybe we need a change similar to bpo-28411 (commit 86b7afdfeee77993fe896a2aa13b3f4f95973f16) which removed the "modules" field from Py_InterpreterState. |
|||
| msg301904 - (view) | Author: Eric Snow (eric.snow) * (Python committer) | Date: 2017年09月11日 21:21 | |
I'm looking into this. |
|||
| msg301906 - (view) | Author: Eric Snow (eric.snow) * (Python committer) | Date: 2017年09月11日 21:31 | |
Moving warnoptions (and xoptions) out of PyInterpreterState seems like a good idea to me for the same reasons as applied to sys.modules. The case for these two is even stronger since they are only used in sysmodule.c. |
|||
| msg302154 - (view) | Author: Eric Snow (eric.snow) * (Python committer) | Date: 2017年09月14日 07:36 | |
New changeset dae0276bb6bc7281d59fb0b8f1aab31634ee80dc by Eric Snow in branch 'master': bpo-30860: Fix a refleak. (#3567) https://github.com/python/cpython/commit/dae0276bb6bc7281d59fb0b8f1aab31634ee80dc |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:52 | admin | set | github: 75601 |
| 2017年09月14日 07:36:00 | eric.snow | set | messages: + msg302154 |
| 2017年09月14日 07:15:42 | eric.snow | set | pull_requests: + pull_request3557 |
| 2017年09月12日 11:39:13 | skrah | link | issue31408 superseder |
| 2017年09月12日 01:00:56 | eric.snow | set | status: open -> closed resolution: fixed stage: patch review -> resolved |
| 2017年09月11日 22:54:11 | eric.snow | set | keywords:
+ patch stage: patch review pull_requests: + pull_request3500 |
| 2017年09月11日 21:31:38 | eric.snow | set | messages: + msg301906 |
| 2017年09月11日 21:21:13 | eric.snow | set | messages: + msg301904 |
| 2017年09月11日 21:21:02 | eric.snow | set | assignee: eric.snow |
| 2017年09月11日 20:48:58 | eric.snow | set | nosy:
+ eric.snow |
| 2017年09月11日 17:16:19 | vstinner | set | messages: + msg301891 |
| 2017年09月11日 17:14:04 | vstinner | set | nosy:
+ ncoghlan, eric.smith messages: + msg301889 |
| 2017年09月11日 16:36:20 | skrah | set | nosy:
+ skrah messages: + msg301886 |
| 2017年09月11日 16:30:05 | vstinner | set | messages: + msg301883 |
| 2017年09月11日 16:29:21 | vstinner | create | |