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

[3.12] gh-104690: thread_run() checks for tstate dangling pointer (#109056) #109133

Merged
merged 1 commit into from
Oct 2, 2023

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Sep 8, 2023

thread_run() of _threadmodule.c now calls
_PyThreadState_CheckConsistency() to check if tstate is a dangling pointer when Python is built in debug mode.

Rename ceval_gil.c is_tstate_valid() to
_PyThreadState_CheckConsistency() to reuse it in _threadmodule.c.

(cherry picked from commit f63d378)

…hon#109056)

thread_run() of _threadmodule.c now calls
_PyThreadState_CheckConsistency() to check if tstate is a dangling
pointer when Python is built in debug mode.

Rename ceval_gil.c is_tstate_valid() to
_PyThreadState_CheckConsistency() to reuse it in _threadmodule.c.

(cherry picked from commit f63d378)
@Yhg1s
Copy link
Member

Yhg1s commented Sep 12, 2023

FYI, I'm delaying this until 3.12.1.

@vstinner
Copy link
Member Author

Note for myself: when this change is backported to 3.12, I should also backport #109135 which is the real fix. This change only provides a better error message when the bug occurs.

@Yhg1s Yhg1s merged commit 30748d3 into python:3.12 Oct 2, 2023
23 checks passed
@vstinner vstinner deleted the tstate_consistency312 branch October 4, 2023 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants