Skip to content

Commit 3654633

Browse files
committed
manually backport pythongh-134336
1 parent 5746e06 commit 3654633

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Python/ceval.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,11 @@ _Py_InitializeRecursionLimits(PyThreadState *tstate)
439439
_tstate->c_stack_soft_limit = _tstate->c_stack_hard_limit + _PyOS_STACK_MARGIN_BYTES;
440440
#else
441441
uintptr_t here_addr = _Py_get_machine_stack_pointer();
442-
# if defined(HAVE_PTHREAD_GETATTR_NP) && !defined(_AIX) && !defined(__NetBSD__)
442+
// XXX musl supports HAVE_PTHRED_GETATTR_NP, but the resulting stack size
443+
/// (on alpine at least) is much smaller than expected and imposes undue limits
444+
/// compared to the old stack size estimation. (We assume musl is not glibc.)
445+
# if defined(HAVE_PTHREAD_GETATTR_NP) && !defined(_AIX) && \
446+
!defined(__NetBSD__) && (defined(__GLIBC__) || !defined(__linux__))
443447
size_t stack_size, guard_size;
444448
void *stack_addr;
445449
pthread_attr_t attr;

0 commit comments

Comments
 (0)