Issue 18565: Test for closing delegating generator with cleared frame (Issue17669) (original) (raw)

Issue18565

Created on 2013-07-27 00:01 by pconnell, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
gen_close_with_cleared_frame.diff pconnell,2013-07-27 00:01 review
gen_close_with_cleared_frame.diff pconnell,2013-07-27 20:37 review
Messages (4)
msg193765 - (view) Author: Phil Connell (pconnell) * Date: 2013-07-27 00:01
This is a testcase for - it passes against the latest default (and hits the same segfault under 3.3.0). I came up with this while tracking down a thorny generator finalisation crash that turned out to be a variant on 17669. The root cause was gen_close being called on a generator that's delegating to another, and whose frame has already had frame_clear called (so f_stacktop is NULL). It's reproduced by creating a reference cycle that's broken by clearing the delegating generator's frame.
msg193775 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2013-07-27 06:07
Thanks! It looks good except I think you could use the support.disable_gc() context manager.
msg193794 - (view) Author: Phil Connell (pconnell) * Date: 2013-07-27 20:37
Good suggestion, updated patch attached.
msg193798 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-07-27 21:07
New changeset 516303f32bad by Benjamin Peterson in branch '3.3': add a test for issue #17669 (closes #18565) http://hg.python.org/cpython/rev/516303f32bad New changeset f90e7540dcba by Benjamin Peterson in branch 'default': merge 3.3 (#18565) http://hg.python.org/cpython/rev/f90e7540dcba
History
Date User Action Args
2022-04-11 14:57:48 admin set github: 62765
2013-07-27 21:07:38 python-dev set status: open -> closednosy: + python-devmessages: + resolution: fixedstage: resolved
2013-07-27 20:37:21 pconnell set files: + gen_close_with_cleared_frame.diffmessages: +
2013-07-27 06:07:53 benjamin.peterson set messages: +
2013-07-27 00:01:47 pconnell create