Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
[3.14] gh-139653: Add PyUnstable_ThreadState_SetStackProtection() (GH-139668)#141661
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
… limit on macOS (pythonGH-139232)Use `pthread_get_stackaddr_np()` and `pthread_get_stacksize_np()` to determine the stack address and size.
…honGH-139668)Add PyUnstable_ThreadState_SetStackProtection() andPyUnstable_ThreadState_ResetStackProtection() functionsto set the stack base address and stack size of a Pythonthread state.Co-authored-by: Petr Viktorin <encukou@gmail.com>
…pythonGH-141551)These checks were invalid and failed randomly on FreeBSDand Alpine Linux.
encukou commentedNov 17, 2025
@hugovk, this will change the internal ABI. |
vstinner commentedNov 17, 2025
I would prefer to wait to see how the discussionhttps://discuss.python.org/t/python-3-14-0-is-incompatible-with-stack-switching-systems-what-do-we-do/104880 goes and see if this API solves the issue, or if we need another solution. |
vstinner commentedNov 17, 2025
If this API cannot be used by most projects and abetter fix can be designed, I would even suggest to remove this API from the main branch. |
vstinner commentedNov 24, 2025
#141404 has been merged causing conflicts. Can you please update your PR to solve conflicts? |
Uh oh!
There was an error while loading.Please reload this page.
vstinner commentedNov 24, 2025
#141711 has been merged: it should fix#139653 for most impacted projects. But according to@markshannon, |
vstinner left a comment
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.
LGTM
32a38a2 intopython:3.14Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
This backports recent changes to the stack protection mechanism, and the unstable API to control it:
📚 Documentation preview 📚:https://cpython-previews--141661.org.readthedocs.build/