Repository navigation
[3.15] gh-159603: Use pthread_attr_get_np() on FreeBSD (#159604) - #159928
Merged
Merged
Conversation
Use pthread_attr_get_np() on FreeBSD to get the stack size (and guard size) of the current thread. Check if pthread_attr_get_np() function and <pthread_np.h> header are available in configure. Update test_json.test_recursion. On FreeBSD 16 with a default stack size of 512 MB, the json C implementation no longer raises RecursionError in test_highly_nested_objects_encoding(). Reduce also max_depth from 5,000 to 2,000 so test_highly_nested_objects_encoding() of the Python implementation only takes 1.6 seconds, instead of 12 seconds. (cherry picked from commit 71ba39d)
vstinner
requested review from
AA-Turner,
corona10,
emmatyping,
erlend-aasland and
markshannon
as code owners
October 20, 2026 18:05
Member
Author
|
!buildbot FreeBSD |
|
🤖 New build scheduled with the buildbot fleet by @vstinner for commit d036bad 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F159928%2Fmerge The command will test the builders whose names match following regular expression: The builders matched are:
|
Member
Author
|
The 3.15 branch is also affected by issue #159535 and so we need to backport the change to 3.15. For example, test_lazy_import fails on AMD64 FreeBSD14 3.15: https://buildbot.python.org/#/builders/2024/builds/495. |
Member
Author
Ok good, the test suite passed on these two FreeBSD buildbots. |
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.
Use pthread_attr_get_np() on FreeBSD to get the stack size (and guard size) of the current thread.
Check if pthread_attr_get_np() function and <pthread_np.h> header are available in configure.
Update test_json.test_recursion. On FreeBSD 16 with a default stack size of 512 MB, the json C implementation no longer raises RecursionError in test_highly_nested_objects_encoding(). Reduce also max_depth from 5,000 to 2,000 so test_highly_nested_objects_encoding() of the Python implementation only takes 1.6 seconds, instead of 12 seconds.
(cherry picked from commit 71ba39d)