-
Notifications
You must be signed in to change notification settings - Fork 7.8k
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
Fix assertion failure in generator dtor #16025
Conversation
I assume the ABI break is because of the removal of |
The labeler is dumb. If there is no ABI break, just remove the label (if |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm approving it because the changes are definitely right, just without caching.
Caching would be nice, but I suppose we can defer that until it actually becomes a problem?! (As far as I'm aware it hasn't been one.)
Fixes GH-15866. Related: GH-15158, GH-10462.
I don't remember why I assumed that a generator with the ZEND_GENERATOR_IN_FIBER flag (implying the generator is running) could only be dtor during shutdown, but this assumption was wrong. It can happen during GC, of course.
Unfortunately it means that we can not cache the result of
check_node_running_in_fiber()
anymore, so we may traverse the tree more than once. However we only ever call this function when collecting a Fiber, which I expect to be rare.This is already the 3rd follow up of GH-10462, so I considered this idea again, but since we can start fibers in destructors now, this is not trivial.