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.