Issue 29655: Certain errors during IMPORT_STAR can leak a reference (original) (raw)

Issue29655

Created on 2017-02-25 21:26 by Peter Cawley, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue29655-2.7.patch serhiy.storchaka,2017-02-28 06:13
Pull Requests
URL Status Linked Edit
PR 301 merged mbussonn,2017-02-26 01:28
PR 348 merged berker.peksag,2017-02-27 16:43
PR 349 merged berker.peksag,2017-02-27 16:45
PR 510 merged serhiy.storchaka,2017-03-06 11:00
Messages (8)
msg288582 - (view) Author: Peter Cawley (Peter Cawley) Date: 2017-02-25 21:26
In the implementation of the IMPORT_STAR opcode, if the call to PyFrame_FastToLocalsWithError fails, or f_locals is NULL, then control flow jumps to the error handler without performing a decref on the "from" variable. As the "from" variable is initialised by POPping from the stack, the reference is leaked.
msg288664 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-02-27 19:11
It looks to me that 2.7 has this bug.
msg288665 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2017-02-27 19:29
I ignored 2.7 because you know... it's 2.7 :) And you said [1] that it doesn't have a big effect on real applications. [1] https://github.com/python/cpython/pull/301#issuecomment-282789185
msg288694 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-02-28 06:13
But it is *very easy* to fix this bug in 2.7.
msg290263 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-03-24 22:41
New changeset 9fbb65e6464b56c6d677090e185c9fe16a80ed96 by Serhiy Storchaka in branch '2.7': bpo-29655: Fixed possible reference leaks in `import *`. (#301) (#510) https://github.com/python/cpython/commit/9fbb65e6464b56c6d677090e185c9fe16a80ed96
msg290362 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2017-03-24 23:36
New changeset 0dadf56737f591c83d18db5e445960d39448583e by Berker Peksag in branch '3.5': bpo-29655: Fixed possible reference leaks in `import *`. (#301) (#349) https://github.com/python/cpython/commit/0dadf56737f591c83d18db5e445960d39448583e
msg290363 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2017-03-24 23:36
New changeset 7accf2033d03025cc5324f8b9d22582bca3623e9 by Berker Peksag in branch '3.6': bpo-29655: Fixed possible reference leaks in `import *`. (#301) (#348) https://github.com/python/cpython/commit/7accf2033d03025cc5324f8b9d22582bca3623e9
msg290399 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-03-24 23:45
New changeset 160edb43571311a3785785c1dfa784afc52d87be by Serhiy Storchaka (Matthias Bussonnier) in branch 'master': bpo-29655: Fixed possible reference leaks in `import *`. (#301) https://github.com/python/cpython/commit/160edb43571311a3785785c1dfa784afc52d87be
History
Date User Action Args
2022-04-11 14:58:43 admin set github: 73841
2017-03-24 23:45:06 serhiy.storchaka set messages: +
2017-03-24 23:36:25 berker.peksag set messages: +
2017-03-24 23:36:11 berker.peksag set messages: +
2017-03-24 22:41:14 serhiy.storchaka set messages: +
2017-03-15 10:49:37 berker.peksag set status: open -> closedresolution: fixedstage: patch review -> resolved
2017-03-06 11:00:19 serhiy.storchaka set pull_requests: + <pull%5Frequest419>
2017-02-28 06:13:33 serhiy.storchaka set status: closed -> openfiles: + issue29655-2.7.patchversions: + Python 2.7, - Python 3.5, Python 3.6, Python 3.7keywords: + patchresolution: fixed -> (no value)messages: + stage: resolved -> patch review
2017-02-27 19:29:53 berker.peksag set nosy: + berker.peksagmessages: +
2017-02-27 19:11:26 serhiy.storchaka set messages: +
2017-02-27 18:25:59 berker.peksag set status: open -> closedstage: needs patch -> resolvedresolution: fixedversions: - Python 2.7
2017-02-27 16:45:34 berker.peksag set pull_requests: + <pull%5Frequest301>
2017-02-27 16:43:38 berker.peksag set pull_requests: + <pull%5Frequest300>
2017-02-26 01:28:54 mbussonn set pull_requests: + <pull%5Frequest267>
2017-02-25 21:49:58 serhiy.storchaka set nosy: + serhiy.storchakastage: needs patchtype: behavior -> resource usageversions: + Python 2.7, Python 3.5, Python 3.6
2017-02-25 21:49:19 mbussonn set nosy: + mbussonn
2017-02-25 21:26:53 Peter Cawley create