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

Memleak in import.c load_source_module() #58966

Closed
cassou mannequin opened this issue May 9, 2012 · 6 comments
Closed

Memleak in import.c load_source_module() #58966

cassou mannequin opened this issue May 9, 2012 · 6 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) performance Performance or resource usage

Comments

@cassou
Copy link
Mannequin

cassou mannequin commented May 9, 2012

BPO 14761
Nosy @malemburg, @tim-one, @brettcannon, @ncoghlan, @pitrou, @benjaminp
Files
  • fix_load_source_module_leak.patch: Patch that fixes a memory leak in load_source_module() from import.c
  • 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 2012-05-09.11:31:36.189>
    created_at = <Date 2012-05-09.08:45:54.556>
    labels = ['interpreter-core', 'performance']
    title = 'Memleak in import.c load_source_module()'
    updated_at = <Date 2012-05-09.11:31:36.188>
    user = 'https://bugs.python.org/cassou'

    bugs.python.org fields:

    activity = <Date 2012-05-09.11:31:36.188>
    actor = 'pitrou'
    assignee = 'none'
    closed = True
    closed_date = <Date 2012-05-09.11:31:36.189>
    closer = 'pitrou'
    components = ['Interpreter Core']
    creation = <Date 2012-05-09.08:45:54.556>
    creator = 'cassou'
    dependencies = []
    files = ['25507']
    hgrepos = []
    issue_num = 14761
    keywords = ['patch']
    message_count = 6.0
    messages = ['160262', '160264', '160265', '160271', '160272', '160274']
    nosy_count = 8.0
    nosy_names = ['lemburg', 'tim.peters', 'brett.cannon', 'ncoghlan', 'pitrou', 'benjamin.peterson', 'python-dev', 'cassou']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'resource usage'
    url = 'https://bugs.python.org/issue14761'
    versions = ['Python 2.7', 'Python 3.2']

    @cassou
    Copy link
    Mannequin Author

    cassou mannequin commented May 9, 2012

    In load_source_module() function from import.c, it looks like Py_DECREF is not called where it should be. Please find attached a patch that fixes the leak.

    This bug has been found using Coccinelle (http://coccinelle.lip6.fr/) using a semantic patch (similar to https://gist.github.com/2634899).

    @cassou cassou mannequin added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label May 9, 2012
    @pitrou
    Copy link
    Member

    pitrou commented May 9, 2012

    Is it 2.7-only?

    @pitrou pitrou added the performance Performance or resource usage label May 9, 2012
    @cassou
    Copy link
    Mannequin Author

    cassou mannequin commented May 9, 2012

    @pitrou I just checked Python-2.7.3 and the tip of the mercurial repository. It's not in the latter at least.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented May 9, 2012

    New changeset a775fc27f469 by Antoine Pitrou in branch '2.7':
    Issue bpo-14761: Fix potential leak on an error case in the import machinery.
    http://hg.python.org/cpython/rev/a775fc27f469

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented May 9, 2012

    New changeset 9de4d85e4197 by Antoine Pitrou in branch '3.2':
    Issue bpo-14761: Fix potential leak on an error case in the import machinery.
    http://hg.python.org/cpython/rev/9de4d85e4197

    New changeset 840cb46d0395 by Antoine Pitrou in branch 'default':
    Null merge for issue bpo-14761.
    http://hg.python.org/cpython/rev/840cb46d0395

    @pitrou
    Copy link
    Member

    pitrou commented May 9, 2012

    Fixed, thank you!

    @pitrou pitrou closed this as completed May 9, 2012
    @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
    interpreter-core (Objects, Python, Grammar, and Parser dirs) performance Performance or resource usage
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant