[3.14] GH-139653: Only raise an exception (or fatal error) when the stack pointer is about to overflow the stack. (GH-141711) by encukou · Pull Request #141944 · python/cpython
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
I'm also including the whole page of internal documentation, rather than ignore the conflict there.