This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: _PyCode_SetExtra behaviour wrong on allocation failure and after realloc
Type: resource usage Stage: resolved
Components: Interpreter Core Versions: Python 3.7, Python 3.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: serhiy.storchaka Nosy List: brianfcoleman, serhiy.storchaka, vstinner
Priority: normal Keywords:

Created on 2017-03-01 08:52 by brianfcoleman, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 376 merged brianfcoleman, 2017-03-01 08:57
PR 402 merged brianfcoleman, 2017-03-02 21:24
PR 703 larry, 2017-03-17 21:00
PR 552 closed dstufft, 2017-03-31 16:36
Messages (6)
msg288745 - (view) Author: Brian Coleman (brianfcoleman) * Date: 2017-03-01 08:52
On PyMem_Malloc failure, _PyCode_SetExtra should set co_extra->ce_size = 0.
On PyMem_Realloc failure, _PyCode_SetExtra should set co_extra->ce_size = 0.
On PyMem_Realloc success, _PyCode_SetExtra should set all unused slots in co_extra->ce_extras to NULL.

I will add a GitHub PR for this shortly.
msg288747 - (view) Author: Brian Coleman (brianfcoleman) * Date: 2017-03-01 08:58
I have now added a Github pull request here:
https://github.com/python/cpython/pull/376
msg288833 - (view) Author: Brian Coleman (brianfcoleman) * Date: 2017-03-02 21:40
I have created a pull request to backport the fix onto 3.6 here:
https://github.com/python/cpython/pull/402
msg288858 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-03-03 05:35
Thank you for your contribution Brian.
msg290341 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-03-24 23:13
New changeset a6e84933d204f807e0e81b6a2237193b2e8ab89a by Serhiy Storchaka (Brian Coleman) in branch '3.6':
bpo-29683 - Fixes to _PyCode_SetExtra when co_extra->ce->extras is (#402)
https://github.com/python/cpython/commit/a6e84933d204f807e0e81b6a2237193b2e8ab89a
msg290348 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-03-24 23:15
New changeset 6a9122ce6969902e119133dac660bf515616c7dd by Victor Stinner (Brian Coleman) in branch 'master':
bpo-29683 - Fixes to _PyCode_SetExtra when co_extra->ce->extras is (#376)
https://github.com/python/cpython/commit/6a9122ce6969902e119133dac660bf515616c7dd
History
Date User Action Args
2022-04-11 14:58:43adminsetgithub: 73869
2017-03-31 16:36:12dstufftsetpull_requests: + pull_request882
2017-03-24 23:15:27vstinnersetnosy: + vstinner
messages: + msg290348
2017-03-24 23:13:11serhiy.storchakasetmessages: + msg290341
2017-03-17 21:00:35larrysetpull_requests: + pull_request617
2017-03-03 05:35:28serhiy.storchakasetstatus: open -> closed
resolution: fixed
messages: + msg288858

stage: patch review -> resolved
2017-03-02 21:40:15brianfcolemansetmessages: + msg288833
2017-03-02 21:24:39brianfcolemansetpull_requests: + pull_request333
2017-03-01 11:37:06serhiy.storchakasetassignee: serhiy.storchaka
stage: patch review

nosy: + serhiy.storchaka
versions: + Python 3.6
2017-03-01 08:58:36brianfcolemansetmessages: + msg288747
2017-03-01 08:57:17brianfcolemansetpull_requests: + pull_request312
2017-03-01 08:52:12brianfcolemancreate