Skip to content

Commit 0d8f676

Browse files
committed
Disable new stack size code for non-glibc.
MUSL claims to support pthread_getattr_np, but the response returned is off by at least an order of magnitude compared to reality. This is apparently a long standing problem. MUSL also does not provide any way to detect directly that it is the libc. It would be possible to add things to configure to detect that MUSL is the compiler, but since this code has caused problems for a lot of non-glibc platforms, it seems easier to just restrict it to glibc.
1 parent 92f85ff commit 0d8f676

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Python/ceval.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,8 @@ _Py_InitializeRecursionLimits(PyThreadState *tstate)
442442
_tstate->c_stack_soft_limit = _tstate->c_stack_hard_limit + PYOS_STACK_MARGIN_BYTES;
443443
#else
444444
uintptr_t here_addr = _Py_get_machine_stack_pointer();
445-
# if defined(HAVE_PTHREAD_GETATTR_NP) && !defined(_AIX) && !defined(__NetBSD__)
445+
# if defined(HAVE_PTHREAD_GETATTR_NP) && !defined(_AIX) && \
446+
!defined(__NetBSD__) && defined(__GLIBC__)
446447
size_t stack_size, guard_size;
447448
void *stack_addr;
448449
pthread_attr_t attr;

0 commit comments

Comments
 (0)