-
-
Notifications
You must be signed in to change notification settings - Fork 31.3k
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
Implement stack overflow protection for linux based on actual stack depth #130396
Labels
interpreter-core
(Objects, Python, Grammar, and Parser dirs)
OS-linux
type-feature
A feature request or enhancement
Comments
markshannon
added a commit
that referenced
this issue
Feb 25, 2025
* Implement C recursion protection with limit pointers for Linux, MacOS and Windows * Remove calls to PyOS_CheckStack * Add stack protection to parser * Make tests more robust to low stacks * Improve error messages for stack overflow
This broke two buildbots (both can be seen in the pre-merge run):
Do you have any leads on these issues? |
This was referenced Feb 25, 2025
markshannon
added a commit
that referenced
this issue
Feb 25, 2025
markshannon
added a commit
that referenced
this issue
Feb 26, 2025
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Feb 26, 2025
…-130550) (cherry picked from commit 129db32) Co-authored-by: Mark Shannon <[email protected]>
This was referenced Feb 26, 2025
vstinner
pushed a commit
that referenced
this issue
Feb 26, 2025
vstinner
added a commit
that referenced
this issue
Feb 26, 2025
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Feb 26, 2025
…ythonGH-130550) (pythonGH-130573) pythonGH-130396: Treat clang -Og as optimized for gdb tests (pythonGH-130550) (cherry picked from commit 129db32) (cherry picked from commit c4aeb4c) Co-authored-by: Victor Stinner <[email protected]> Co-authored-by: Mark Shannon <[email protected]>
pablogsal
pushed a commit
that referenced
this issue
Feb 27, 2025
I'm seeing SIGBUS in a compilation modes that use a lot of stack:
EDIT: The suppressions seems to be important for reproducing the crash. |
colesbury
added a commit
to colesbury/cpython
that referenced
this issue
Mar 7, 2025
Thread sanitizer will often crash if a test uses more than half the stack.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
interpreter-core
(Objects, Python, Grammar, and Parser dirs)
OS-linux
type-feature
A feature request or enhancement
Linux doesn't offer an API for determining the current stack bounds, at least not that I am aware of.
This means we will need to probe the stack using a SIGSEGV handler and longjmp/setjump.
It is somewhat ugly but should work.
Actually, it looks like
pthread_get_stackaddr_np
might work, and avoid all the complexity of the signal handler. In theory, it should work for MacOS as well.Linked PRs
The text was updated successfully, but these errors were encountered: