bpo-33612: Remove PyThreadState_Clear() assertion#7069
bpo-33612: Remove PyThreadState_Clear() assertion#7069vstinner merged 1 commit intopython:masterfrom vstinner:thread_clear
Conversation
|
LGTM. |
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.
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 <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. |
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