gh-113787: Fix refleaks in test_capi#113816
Merged
Merged
Conversation
Eclips4
approved these changes
Jan 8, 2024
Member
There was a problem hiding this comment.
Great job! Thanks.
Refleak tests with this patch:
./python -m test -R 3:3 test_capi
Using random seed: 898642448
0:00:00 load avg: 0.02 Run 1 test sequentially
0:00:00 load avg: 0.02 [1/1] test_capi
beginning 6 repetitions
123456
......
test_capi passed in 33.7 sec
== Tests result: SUCCESS ==
1 test OK.
Total duration: 33.7 sec
Total tests: run=823 skipped=4
Total test files: run=1/1
Result: SUCCESS
kulikjak
pushed a commit
to kulikjak/cpython
that referenced
this pull request
Jan 22, 2024
Fix refleaks and a typo.
aisk
pushed a commit
to aisk/cpython
that referenced
this pull request
Feb 11, 2024
Fix refleaks and a typo.
Glyphack
pushed a commit
to Glyphack/cpython
that referenced
this pull request
Sep 2, 2024
Fix refleaks and a typo.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since b2566d8, the
_testcapimodule has specified a non-negative value toPyModuleDef.m_size, which seems to require a bit different refcount management. Every (sub-) interpreter now calls the single phasePyInit__testcapi()with each module state. Previously, the call was only once when running the subinterpreter test case, and repeatingPy_INCREF(TestError)n-times inPyInit__testcapidid not affect passing the refleak test for me.The patch for
vectorcall_limited.cfollows the way instructmember.ccc @nascheme @ericsnowcurrently @Eclips4
test_capihas refleaks #113787