You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(...) will convert it to use per-module state in a separate issue.
Great!
phsilva commented on Apr 1, 2020
phsilvamannequin
Mannequin
More actions
As discussed on PR19172, this module uses a global state in functions that do not receive a PyModule* and right now converting such cases to per-module state is not trivial. I will wait for PEP-573 implementation that will hopefully make this easier.
Pushed PR19273 to avoid the potential crash induced by the original change.
Activity
vstinner commentedon Mar 26, 2020
$ ./python -m test -R 3:3 test__xxsubinterpreters -m test_ids_global 0:00:00 load avg: 0.80 Run tests sequentially 0:00:00 load avg: 0.80 [1/1] test__xxsubinterpreters beginning 6 repetitions 123456 ...... test__xxsubinterpreters leaked [1, 1, 1] references, sum=3 test__xxsubinterpreters leaked [1, 1, 1] memory blocks, sum=3 test__xxsubinterpreters failed== Tests result: FAILURE ==
1 test failed:
test__xxsubinterpreters
Total duration: 819 ms
Tests result: FAILURE
It started to leak since:
commit 7dd549e
Author: Paulo Henrique Silva <ph.silva@carta.com>
Date: Tue Mar 24 23:19:58 2020 -0300
vstinner commentedon Mar 26, 2020
The folowing test is enough to reproduce the leak:
phsilva commentedon Mar 26, 2020
I've got it, will investigate asap.
phsilva commentedon Mar 26, 2020
The module still uses static state. Fixed the leak and will convert it to use per-module state in a separate issue.
vstinner commentedon Mar 26, 2020
New changeset b09ae3f by Paulo Henrique Silva in branch 'master':
bpo-40071: Fix refleak in _functools module (GH19172)
b09ae3f
vstinner commentedon Mar 26, 2020
Great!
phsilva commentedon Apr 1, 2020
As discussed on PR19172, this module uses a global state in functions that do not receive a PyModule* and right now converting such cases to per-module state is not trivial. I will wait for PEP-573 implementation that will hopefully make this easier.
Pushed PR19273 to avoid the potential crash induced by the original change.
vstinner commentedon Apr 1, 2020
New changeset eacc074 by Paulo Henrique Silva in branch 'master':
bpo-40071: Fix potential crash in _functoolsmodule.c (GH-19273)
eacc074
vstinner commentedon Apr 1, 2020
I closed the issue, the leak is now fixed and _functools has been fixed.
I created bpo-40137: TODO list when PEP-573 "Module State Access from C Extension Methods" will be implemented.