classification
Title: [EASY][2.7] test_recursive_repr() of test_xml_etree_c leaks references
Type: resource usage Stage: resolved
Components: Tests, XML Versions: Python 2.7
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: vstinner
Priority: normal Keywords: easy (C)

Created on 2017-06-09 15:29 by vstinner, last changed 2017-06-12 13:50 by matrixise. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 2129 merged matrixise, 2017-06-12 12:30
Messages (3)
msg295543 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-06-09 15:29
haypo@selma$ ./python -m test -R 3:3 -m test_recursive_repr test_xml_etree_c
Run tests sequentially
0:00:00 [1/1] test_xml_etree_c
beginning 6 repetitions
123456
......
test_xml_etree_c leaked [4, 4, 4] references, sum=12
1 test failed:
    test_xml_etree_c

Total duration: 179 ms
Tests result: FAILURE
[64152 refs]
msg295550 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-06-09 16:21
The leak is in the element_repr() function of Modules/_elementtree.c.

Py_ReprEnter() creates an internal list to track objects, and so requires that Py_ReprLeave() is always called, even on error, to destroy these objects. Is it the case here? ;-)
msg295780 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-06-12 13:30
New changeset 41af942e57f9a450cf273ef6b72a21380c6ba8d1 by Victor Stinner (St├ęphane Wirtel) in branch '2.7':
bpo-30615: Fix the leak reference in Modules/_elementtree.c (#2129)
https://github.com/python/cpython/commit/41af942e57f9a450cf273ef6b72a21380c6ba8d1
History
Date User Action Args
2017-06-12 13:50:23matrixisesetstatus: open -> closed
stage: resolved
2017-06-12 13:30:50vstinnersetmessages: + msg295780
2017-06-12 12:30:10matrixisesetpull_requests: + pull_request2183
2017-06-09 16:21:29vstinnersetkeywords: + easy (C)

messages: + msg295550
2017-06-09 15:29:04vstinnercreate