File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
Misc/NEWS.d/next/Core_and_Builtins Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change 1+ Disable computed stack limit checks on non-glibc linux platforms to fix
2+ crashes on deep recursion.
Original file line number Diff line number Diff line change @@ -452,7 +452,11 @@ _Py_InitializeRecursionLimits(PyThreadState *tstate)
452452 _tstate -> c_stack_soft_limit = _tstate -> c_stack_hard_limit + _PyOS_STACK_MARGIN_BYTES ;
453453#else
454454 uintptr_t here_addr = _Py_get_machine_stack_pointer ();
455- # if defined(HAVE_PTHREAD_GETATTR_NP ) && !defined(_AIX ) && !defined(__NetBSD__ )
455+ /// XXX musl supports HAVE_PTHRED_GETATTR_NP, but the resulting stack size
456+ /// (on alpine at least) is much smaller than expected and imposes undue limits
457+ /// compared to the old stack size estimation. (We assume musl is not glibc.)
458+ # if defined(HAVE_PTHREAD_GETATTR_NP ) && !defined(_AIX ) && \
459+ !defined(__NetBSD__ ) && (defined(__GLIBC__ ) || !defined(__linux__ ))
456460 size_t stack_size , guard_size ;
457461 void * stack_addr ;
458462 pthread_attr_t attr ;
You can’t perform that action at this time.
0 commit comments