Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EASY][2.7] test_recursive_repr() of test_xml_etree_c leaks references #74800

Closed
vstinner opened this issue Jun 9, 2017 · 3 comments
Closed
Labels
easy performance Performance or resource usage tests Tests in the Lib/test dir topic-XML

Comments

@vstinner
Copy link
Member

vstinner commented Jun 9, 2017

BPO 30615
Nosy @vstinner
PRs
  • bpo-30615: Fix the leak reference in Modules/_elementtree.c #2129
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2017-06-12.13:50:23.112>
    created_at = <Date 2017-06-09.15:29:04.872>
    labels = ['expert-XML', 'easy', 'tests', 'performance']
    title = '[EASY][2.7] test_recursive_repr() of test_xml_etree_c leaks references'
    updated_at = <Date 2017-06-12.13:50:23.111>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2017-06-12.13:50:23.111>
    actor = 'matrixise'
    assignee = 'none'
    closed = True
    closed_date = <Date 2017-06-12.13:50:23.112>
    closer = 'matrixise'
    components = ['Tests', 'XML']
    creation = <Date 2017-06-09.15:29:04.872>
    creator = 'vstinner'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 30615
    keywords = ['easy (C)']
    message_count = 3.0
    messages = ['295543', '295550', '295780']
    nosy_count = 1.0
    nosy_names = ['vstinner']
    pr_nums = ['2129']
    priority = 'normal'
    resolution = None
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'resource usage'
    url = 'https://bugs.python.org/issue30615'
    versions = ['Python 2.7']

    @vstinner
    Copy link
    Member Author

    vstinner commented Jun 9, 2017

    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]

    @vstinner vstinner added tests Tests in the Lib/test dir topic-XML performance Performance or resource usage labels Jun 9, 2017
    @vstinner
    Copy link
    Member Author

    vstinner commented Jun 9, 2017

    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? ;-)

    @vstinner vstinner added the easy label Jun 9, 2017
    @vstinner
    Copy link
    Member Author

    New changeset 41af942 by Victor Stinner (Stéphane Wirtel) in branch '2.7':
    bpo-30615: Fix the leak reference in Modules/_elementtree.c (bpo-2129)
    41af942

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    easy performance Performance or resource usage tests Tests in the Lib/test dir topic-XML
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants