Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Python now uses a stack size of at least 2 MiB, instead of 1 MiB. This is
especially needed when Python is linked to musl (ex: Alpine Linux) which
uses a default stack of 128 kiB. Patch by Victor Stinner.
4 changes: 2 additions & 2 deletions configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2463,8 +2463,9 @@ AS_CASE([$ac_sys_system],
)

dnl On Linux, check the thread stack size. musl (ex: Alpine Linux) uses
dnl a default thread stack size of 128 kB, whereas the glibc uses 8 MiB.
dnl Python needs at least 1 MiB.
dnl a default thread stack size of 128 kiB, whereas the glibc uses 8 MiB.
dnl Python needs at least 2 MiB to run test_threading on Free Threading
dnl (gh-151542).
if test "$ac_sys_system" = "Linux" -a "$cross_compiling" = no; then
AC_CACHE_CHECK([for thread stack size], [ac_cv_thread_stack_size], [
cat > conftest.c <<EOF
Expand All @@ -2485,7 +2486,7 @@ int main()
return 2;
}

if (size < 1024 * 1024) {
if (size < 2 * 1024 * 1024) {
return 1;
}
return 0;
Expand All @@ -2497,7 +2498,7 @@ EOF
./conftest &>/dev/null
exitcode=$?
if test $exitcode -eq 1; then
ac_cv_thread_stack_size=1048576
ac_cv_thread_stack_size=2097152 # 2 MiB
elif test $exitcode -eq 0; then
ac_cv_thread_stack_size="default"
fi
Expand Down
Loading