Repository navigation
Conversation
reporting the stack limit of the main thread incorrectly. On platforms where pthread_getattr_np underreports the main thread's stack size, use RLIMIT_STACK for the main thread instead.
symbols for the Py check.
…doesn't depend on explicitly setting the stack size. It's correct for new threads regardless of that call.
encukou
requested review from
AA-Turner,
corona10,
emmatyping,
erlend-aasland,
itamaro and
markshannon
as code owners
November 10, 2026 14:03
Member
Author
|
!buildbot Alpine |
Member
Author
aozmekik
reviewed
Nov 13, 2026
aozmekik
left a comment
Contributor
There was a problem hiding this comment.
Tested on Alpine 3.22 (musl) x86_64 and aarch64, debug build, against the merge base:
- configure sets
_Py_HAVE_UNRELIABLE_PTHREAD_GETATTR_NPon both. - Main thread
get_c_recursion_remaining(): 1450 -> 12650 withulimit -s 8192(same as glibc), 102250 with 64 MiB, and still 1450 with an unlimited stack. New threads stay at 1450. - test_lazy_import, test_typing, test_json, test_ast, test_compile, test_exceptions, test_pickle and test_threading pass; one of them fails on the merge base.
Nit: on musl configure prints checking whether pthread_getattr_np reports the main thread stack reliably... yes, since the cached value is the inverse. Also, cross builds default to no, so a musl cross build keeps the old limit unless ac_cv_unreliable_pthread_getattr_np=yes is passed. Might be worth defaulting from $host there.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This builds on @Yhg1s's #159376, trying some more things:
unreliable_pthread_getattr_npeven if configure runs with unlimited stack, by limiting it artificially.