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: gen_send_ex: Assertion `f->f_back != ((void *)0)' failed.
Type: Stage:
Components: Interpreter Core Versions: Python 2.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: pje Nosy List: nascheme, pje, rhettinger
Priority: release blocker Keywords:

Created on 2005-08-12 19:20 by nascheme, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg26052 - (view) Author: Neil Schemenauer (nascheme) * (Python committer) Date: 2005-08-12 19:20
Triggering is trival.  Create a script that contains:

    def f():
        yield 1
    g = f()

Run with a debug version of Python:

python: ../Objects/genobject.c:85: gen_send_ex:
Assertion `f->f_back != ((void *)0)' failed.
Aborted (core dumped)
msg26053 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2005-08-13 00:09
Logged In: YES 
user_id=80475

I believe this is related to IDLE crash that I've been seeing.
The problem did not occur just before the checkin:
    cvs up -D "2005-08-01 18:00"
But emerged immediately after:
    cvs up -D "2005-08-01 21:00"
msg26054 - (view) Author: PJ Eby (pje) * (Python committer) Date: 2005-08-13 03:29
Logged In: YES 
user_id=56214

Sadly, this is not the cause of the IDLE problem, because
it's the assert that's wrong here.  The problem that's
occurring is that f->f_back is NULL because the final
garbage collection at shutdown is occurring with a NULL
tstate->frame.  Changing the assert to check that
f->f_back==tstate->frame makes the (meaningless) error go away.

Basically, the problem here is because this code used to be
the iternext routine, and it was never called by the GC. 
Now, generators are closed when they are garbage collected,
so they can be executed during interpreter shutdown.

I've checked in a corrected assertion.
History
Date User Action Args
2022-04-11 14:56:12adminsetgithub: 42275
2005-08-12 19:20:46naschemecreate