-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
bpo-33612: Remove PyThreadState_Clear() assertion #7069
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
Conversation
LGTM. |
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 agree, it is safe to clear just tstate->exc_state
and remove the assertion.
Wait, do you mean that exc_state and/or exc_info must be explicitly cleared? These fields are pointers to data hold by a generator. The best that we can do is to set these pointers to NULL, but it is very likely the the whole tstate memory is going to be freed anyway, so I'm not sure that it's useful. I'm not sure that I understood you correctly. Do you think that the current PR is correct? Or do we need extra changes? |
I think that the current PR is correct.
|
@vstinner: Please replace |
Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7. |
GH-7074 is a backport of this pull request to the 3.7 branch. |
bpo-25612, bpo-33612: Remove an assertion from PyThreadState_Clear() which failed at Python shutdown or on fork if a thread was running a generator. (cherry picked from commit b6dccf5) Co-authored-by: Victor Stinner <[email protected]>
exc_state fields are cleared, not exc_state itself.
I don't feel confortable to make this change. Please write a separated PR if you want to do that. |
bpo-25612, bpo-33612: Remove an assertion from PyThreadState_Clear() which failed at Python shutdown or on fork if a thread was running a generator. (cherry picked from commit b6dccf5) Co-authored-by: Victor Stinner <[email protected]>
bpo-25612, bpo-33612: Remove an assertion from PyThreadState_Clear()
which failed at Python shutdown or on fork if a thread was running a
generator.
https://bugs.python.org/issue33612