classification
Title: Possible reference leak in MAKE_FUNCTION
Type: behavior Stage: resolved
Components: Interpreter Core Versions: Python 3.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: python-dev, serhiy.storchaka, xiang.zhang
Priority: normal Keywords: patch

Created on 2016-05-10 11:00 by xiang.zhang, last changed 2016-05-17 05:54 by python-dev. This issue is now closed.

Files
File name Uploaded Description Edit
make_function_reference_leak.patch xiang.zhang, 2016-05-10 11:00 review
make_function_reference_leak_new.patch xiang.zhang, 2016-05-10 11:01 review
Messages (6)
msg265235 - (view) Author: Xiang Zhang (xiang.zhang) * (Python committer) Date: 2016-05-10 11:00
*names* is not Py_DECREFed in MAKE_FUNCTION in error case.
msg265236 - (view) Author: Xiang Zhang (xiang.zhang) * (Python committer) Date: 2016-05-10 11:01
Sorry, wrong patch. Attach the right one.
msg265239 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2016-05-10 11:29
LGTM. Would be nice to have a test (just compile a function with annotations in a loop).
msg265252 - (view) Author: Xiang Zhang (xiang.zhang) * (Python committer) Date: 2016-05-10 15:10
I'm willing to. But I don't know where is the suitable place to put such a test and since the reference leak only appears in error case, can compile a function with annotations in a loop accomplish the test goal?
msg265680 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2016-05-16 08:08
I don't know what is the best place for this function. You can just break compiling functions with annotations, run tests, found tests that use functions with annotations, and add new test near one of them.

You can test your test by removing the fix and running the test with the "-R :" option.
msg265757 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-05-17 05:54
New changeset eaa3a71a6f62 by Benjamin Peterson in branch '3.5':
fix possible refleak in MAKE_FUNCTION (closes #26991)
https://hg.python.org/cpython/rev/eaa3a71a6f62

New changeset 7270701cf5bc by Benjamin Peterson in branch 'default':
merge 3.5 (#26991)
https://hg.python.org/cpython/rev/7270701cf5bc
History
Date User Action Args
2016-05-17 05:54:33python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg265757

resolution: fixed
stage: test needed -> resolved
2016-05-16 08:08:14serhiy.storchakasetmessages: + msg265680
2016-05-10 15:10:35xiang.zhangsetmessages: + msg265252
2016-05-10 11:29:37serhiy.storchakasettype: behavior
messages: + msg265239
components: + Interpreter Core
stage: test needed
2016-05-10 11:01:55xiang.zhangsetfiles: + make_function_reference_leak_new.patch

messages: + msg265236
2016-05-10 11:00:17xiang.zhangcreate