gh-148260: Use at least 1 MiB stack size on musl#149993
Conversation
On Linux when Python is linked to the musl C library, use a thread stack size of at least 1 MiB instead of musl default which is 128 kiB.
|
On "AMD64 Alpine Linux NoGIL 3.x" buildbot, currently test_threading.test_recursion_limit() does crash with a stack overflow: issue gh-148260. With this change, Python is built with With this change, test_threading.test_recursion_limit() does pass. I tested Python built in debug mode ( |
|
@corona10 @erlend-aasland @picnixz: I'm looking for autotools experts to review my configure.ac change. I'm not comfortable with changing the build system. Currently, the It seems like running a program is the only way to check if Python is linked to the musl library. My change is not specific to the musl library, but instead read the default thread stack size to decide if My configure.ac is inspired by Python 3.12 |
| EOF | ||
|
|
||
| ac_cv_thread_stack_size="default" | ||
| if $CC -pthread $CFLAGS conftest.c -o conftest &>/dev/null; then |
There was a problem hiding this comment.
I chose to use $CC -pthread to make sure that the pthread API can be used in the C program. We check if -pthread is supported above, near line 3064, which sets CC="$CC -pthread" if the flag is supported. I should maybe omit -pthread and move my code after the -pthread check.
|
!buildbot Alpine |
|
🤖 New build scheduled with the buildbot fleet by @zware for commit fd078ac 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F149993%2Fmerge The command will test the builders whose names match following regular expression: The builders matched are:
|
|
Cool, the test suite passed on Alpine Linux buildbots:
|
On Linux when Python is linked to the musl C library, use a thread stack size of at least 1 MiB instead of musl default which is 128 kiB.