Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

gh-132296: Use thread-state reference counting to fix PyEval_SetTraceAllThreads #132298

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

Closed

Conversation

ZeroIntensity
Copy link
Member

@ZeroIntensity ZeroIntensity commented Apr 9, 2025

This extends the refcount field to affect PyThreadState_Delete and friends, letting us keep a thread state alive for slightly longer. This mechanism is far from being robust, because we're still not preventing the thread state from being cleared or other bad things, but it's a really nice start.

We could go the route of letting the reference count field prevent any finalization happening to the thread state, but I want to hear opinions on this approach first.

@ZeroIntensity
Copy link
Member Author

@colesbury -- As you implemented tstate refcounts, I'd like to hear your opinion on this. Do you think using reference counting before finalization is a good idea?

@ZeroIntensity
Copy link
Member Author

I realize that this only fixes concurrent deletion, but not concurrent mutation. Silly me.

@ZeroIntensity ZeroIntensity deleted the gh-132296-set-trace-all-threads branch April 28, 2025 21:46
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.

1 participant
Morty Proxy This is a proxified and sanitized view of the page, visit original site.