[3.14] GH-139653: Only raise an exception (or fatal error) when the stack pointer is about to overflow the stack. (GH-141711)#141892
Closed
hroncok wants to merge 4 commits intopython:3.14python/cpython:3.14from
hroncok:backport-7094f09-3.14hroncok/cpython:backport-7094f09-3.14Copy head branch name to clipboard
Closed
[3.14] GH-139653: Only raise an exception (or fatal error) when the stack pointer is about to overflow the stack. (GH-141711)#141892hroncok wants to merge 4 commits intopython:3.14python/cpython:3.14from hroncok:backport-7094f09-3.14hroncok/cpython:backport-7094f09-3.14Copy head branch name to clipboard
hroncok wants to merge 4 commits intopython:3.14python/cpython:3.14from
hroncok:backport-7094f09-3.14hroncok/cpython:backport-7094f09-3.14Copy head branch name to clipboard
Conversation
… limit on macOS (pythonGH-139232) Use `pthread_get_stackaddr_np()` and `pthread_get_stacksize_np()` to determine the stack address and size. (cherry picked from commit 7016044)
… stack limits (pythonGH-139294) (cherry picked from commit 7094f09)
…hon#139668) Add PyUnstable_ThreadState_SetStackProtection() and PyUnstable_ThreadState_ResetStackProtection() functions to set the stack base address and stack size of a Python thread state. Co-authored-by: Petr Viktorin <encukou@gmail.com> (cherry picked from commit b99db92)
…ack pointer is about to overflow the stack. (pythonGH-141711) Only raises if the stack pointer is both below the limit *and* above the stack base. This prevents false positives for user-space threads, as the stack pointer will be outside those bounds if the stack has been swapped. (cherry picked from commit c25a070)
Member
Contributor
Author
|
I am not sure it includes the Only raise an exception (or fatal error) when the stack pointer is about to overflow the stack commit, but I am happy to close this and finish the work there. |
Member
|
Sure, "Only raise an exception (or fatal error) when the stack pointer is about to overflow the stack" should still be backported. But #141661 is a complex backport for the first part: backport PyUnstable_ThreadState_SetStackProtection() functions and commits preparing this backport. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is my naïve attempt to backport #141711 into the 3.14 branch. I needed to backport several other changes, and at this point am frankly not sure if I know what I am doing :)
Opening as a draft, nevertheless, in case someone wants to take a look.
📚 Documentation preview 📚: https://cpython-previews--141892.org.readthedocs.build/