classification
Title: _PyEval_EvalFrameDefault() doesn't reset tstate->frame if _PyCode_InitOpcache() fails
Type: Stage: resolved
Components: Interpreter Core Versions: Python 3.9, Python 3.8
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: corona10, inada.naoki, pablogsal, vstinner
Priority: normal Keywords: patch

Created on 2020-03-23 14:36 by vstinner, last changed 2020-04-24 01:07 by vstinner. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 19691 merged vstinner, 2020-04-23 21:52
PR 19698 merged vstinner, 2020-04-24 00:44
Messages (6)
msg364850 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-03-23 14:36
tstate->frame is a borrowed references to the current frame object. It's set tp the frame at _PyEval_EvalFrameDefault() and resets to frame->f_back at _PyEval_EvalFrameDefault() exit.

Problem: when _PyCode_InitOpcache() fails, tstate->frame is not reset to frame->f_back.
msg364865 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-03-23 17:24
Note: I found this issue with Pablo Galindo Galgado while investigating bpo-20526.
msg365502 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2020-04-01 18:34
Will prepare a pr soon
msg367164 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-04-24 00:43
New changeset 25104949a5a60ff86c10691e184ce2ecb500159b by Victor Stinner in branch 'master':
bpo-40048: Fix _PyCode_InitOpcache() error path (GH-19691)
https://github.com/python/cpython/commit/25104949a5a60ff86c10691e184ce2ecb500159b
msg367167 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-04-24 01:07
New changeset d9df63deab78f70061a5a24c1f92e6d389fc45f7 by Victor Stinner in branch '3.8':
bpo-40048: Fix _PyCode_InitOpcache() error path (GH-19691) (GH-19698)
https://github.com/python/cpython/commit/d9df63deab78f70061a5a24c1f92e6d389fc45f7
msg367168 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-04-24 01:07
Thanks for the review Pablo ;-)
History
Date User Action Args
2020-04-24 01:07:43vstinnersetstatus: open -> closed
resolution: fixed
messages: + msg367168

stage: patch review -> resolved
2020-04-24 01:07:27vstinnersetmessages: + msg367167
2020-04-24 00:44:33vstinnersetpull_requests: + pull_request19018
2020-04-24 00:43:22vstinnersetmessages: + msg367164
2020-04-23 21:52:10vstinnersetkeywords: + patch
stage: patch review
pull_requests: + pull_request19011
2020-04-01 18:34:22pablogsalsetmessages: + msg365502
2020-04-01 17:34:26corona10setnosy: + corona10
2020-03-23 17:24:30vstinnersetnosy: + inada.naoki, pablogsal
messages: + msg364865
2020-03-23 14:36:53vstinnercreate