Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gen_send_ex: Assertion `f->f_back != ((void *)0)' failed. #42275

Closed
nascheme opened this issue Aug 12, 2005 · 3 comments
Closed

gen_send_ex: Assertion `f->f_back != ((void *)0)' failed. #42275

nascheme opened this issue Aug 12, 2005 · 3 comments
Assignees
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) release-blocker

Comments

@nascheme
Copy link
Member

BPO 1257960
Nosy @nascheme, @rhettinger, @pjeby

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/pjeby'
closed_at = <Date 2005-08-13.03:29:21.000>
created_at = <Date 2005-08-12.19:20:46.000>
labels = ['interpreter-core', 'release-blocker']
title = "gen_send_ex: Assertion `f->f_back != ((void *)0)' failed."
updated_at = <Date 2005-08-13.03:29:21.000>
user = 'https://github.com/nascheme'

bugs.python.org fields:

activity = <Date 2005-08-13.03:29:21.000>
actor = 'pje'
assignee = 'pje'
closed = True
closed_date = None
closer = None
components = ['Interpreter Core']
creation = <Date 2005-08-12.19:20:46.000>
creator = 'nascheme'
dependencies = []
files = []
hgrepos = []
issue_num = 1257960
keywords = []
message_count = 3.0
messages = ['26052', '26053', '26054']
nosy_count = 3.0
nosy_names = ['nascheme', 'rhettinger', 'pje']
pr_nums = []
priority = 'release blocker'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue1257960'
versions = ['Python 2.5']

@nascheme
Copy link
Member Author

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)

@nascheme nascheme added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Aug 12, 2005
@nascheme nascheme added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Aug 12, 2005
@rhettinger
Copy link
Contributor

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"

@pjeby
Copy link
Mannequin

pjeby mannequin commented Aug 13, 2005

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.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) release-blocker
Projects
None yet
Development

No branches or pull requests

2 participants