bpo-33612: Remove PyThreadState_Clear() assertion#7069
Conversation
|
LGTM. |
Sorry, something went wrong.
serhiy-storchaka
left a comment
There was a problem hiding this comment.
I agree, it is safe to clear just tstate->exc_state and remove the assertion.
Sorry, something went wrong.
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? |
Sorry, something went wrong.
|
I think that the current PR is correct.
|
Sorry, something went wrong.
|
@vstinner: Please replace |
Sorry, something went wrong.
|
Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7. |
Sorry, something went wrong.
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 <vstinner@redhat.com>
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. |
Sorry, something went wrong.
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