From 0d8f676380e5558309f32753338d312f3f921e93 Mon Sep 17 00:00:00 2001 From: "R. David Murray" Date: Tue, 20 May 2025 10:16:15 -0400 Subject: [PATCH] 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. --- Python/ceval.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Python/ceval.c b/Python/ceval.c index 490b653f132a6a..efed49b7055fce 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -442,7 +442,8 @@ _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__) +# if defined(HAVE_PTHREAD_GETATTR_NP) && !defined(_AIX) && \ + !defined(__NetBSD__) && defined(__GLIBC__) size_t stack_size, guard_size; void *stack_addr; pthread_attr_t attr;