Mailing List Archive

[issue14761] Memleak in import.c load_source_module()
New submission from Damien Cassou <damien.cassou@gmail.com>:

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).

----------
components: Interpreter Core
files: fix_load_source_module_leak.patch
keywords: patch
messages: 160262
nosy: benjamin.peterson, cassou, lemburg, tim_one
priority: normal
severity: normal
status: open
title: Memleak in import.c load_source_module()
versions: Python 2.7
Added file: http://bugs.python.org/file25507/fix_load_source_module_leak.patch

_______________________________________
Python tracker <report@bugs.python.org>
<http://bugs.python.org/issue14761>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue14761] Memleak in import.c load_source_module() [ In reply to ]
Antoine Pitrou <pitrou@free.fr> added the comment:

Is it 2.7-only?

----------
nosy: +brett.cannon, ncoghlan, pitrou
stage: -> patch review
type: -> resource usage

_______________________________________
Python tracker <report@bugs.python.org>
<http://bugs.python.org/issue14761>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue14761] Memleak in import.c load_source_module() [ In reply to ]
Damien Cassou <damien.cassou@gmail.com> added the comment:

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

----------

_______________________________________
Python tracker <report@bugs.python.org>
<http://bugs.python.org/issue14761>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue14761] Memleak in import.c load_source_module() [ In reply to ]
Roundup Robot <devnull@psf.upfronthosting.co.za> added the comment:

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

----------
nosy: +python-dev

_______________________________________
Python tracker <report@bugs.python.org>
<http://bugs.python.org/issue14761>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue14761] Memleak in import.c load_source_module() [ In reply to ]
Roundup Robot <devnull@psf.upfronthosting.co.za> added the comment:

New changeset 9de4d85e4197 by Antoine Pitrou in branch '3.2':
Issue #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 #14761.
http://hg.python.org/cpython/rev/840cb46d0395

----------

_______________________________________
Python tracker <report@bugs.python.org>
<http://bugs.python.org/issue14761>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue14761] Memleak in import.c load_source_module() [ In reply to ]
Antoine Pitrou <pitrou@free.fr> added the comment:

Fixed, thank you!

----------
resolution: -> fixed
stage: patch review -> committed/rejected
status: open -> closed
versions: +Python 3.2

_______________________________________
Python tracker <report@bugs.python.org>
<http://bugs.python.org/issue14761>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com