mirror of
https://github.com/python/cpython.git
synced 2025-11-01 06:01:29 +00:00
[3.14] gh-131338: Disable computed stack limit checks on non-glibc linux (GH-134336) (#137175)
Co-authored-by: R. David Murray <rdmurray@bitdance.com> Co-authored-by: Kumar Aditya <kumaraditya@python.org> Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
parent
f180fb956b
commit
1878fe814a
2 changed files with 7 additions and 1 deletions
|
|
@ -0,0 +1,2 @@
|
|||
Disable computed stack limit checks on non-glibc linux platforms to fix
|
||||
crashes on deep recursion.
|
||||
|
|
@ -439,7 +439,11 @@ _Py_InitializeRecursionLimits(PyThreadState *tstate)
|
|||
_tstate->c_stack_soft_limit = _tstate->c_stack_hard_limit + _PyOS_STACK_MARGIN_BYTES;
|
||||
#else
|
||||
uintptr_t here_addr = _Py_get_machine_stack_pointer();
|
||||
# if defined(HAVE_PTHREAD_GETATTR_NP) && !defined(_AIX) && !defined(__NetBSD__)
|
||||
/// XXX musl supports HAVE_PTHRED_GETATTR_NP, but the resulting stack size
|
||||
/// (on alpine at least) is much smaller than expected and imposes undue limits
|
||||
/// compared to the old stack size estimation. (We assume musl is not glibc.)
|
||||
# if defined(HAVE_PTHREAD_GETATTR_NP) && !defined(_AIX) && \
|
||||
!defined(__NetBSD__) && (defined(__GLIBC__) || !defined(__linux__))
|
||||
size_t stack_size, guard_size;
|
||||
void *stack_addr;
|
||||
pthread_attr_t attr;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue