| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Add the @support.run_with_limited_c_stack() decorator which runs the test in a thread with a small C stack, so that the outcome does not depend on RLIMIT_STACK. Use it in tests which recurse to a fixed depth -- @support.skip_if_huge_c_stack() failed to skip them with a 16 MiB stack. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
On platforms where the interpreter cannot query the thread stack size it assumes Py_C_STACK_SIZE (4 MiB), so a smaller thread stack crashes instead of raising RecursionError. Verified on illumos and OpenBSD: a 2 MiB stack dumps core, 8 MiB raises RecursionError. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
@kulikjak, could you please test if this helps? |
Sorry, something went wrong.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
The failure of the Windows / Build and test (x64, tail-call) job is gh-155146: test_detach_materialized_dict_no_memory fails if any other allocation happens before the one which detaches the instance dictionary, and adding functions to test.support is enough to shift the sequence. Fixed in #155150. |
Sorry, something went wrong.
|
Thanks! I tested your change and the test suite is green again. |
Sorry, something went wrong.
…h-155109-limited-c-stack
|
Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14, 3.15. |
Sorry, something went wrong.
|
Sorry, @serhiy-storchaka, I could not cleanly backport this to 3.14 due to a conflict. cherry_picker ce5ae29ef9b8ccb32683c922d135339311c36c9d 3.14 |
Sorry, something went wrong.
|
GH-155164 is a backport of this pull request to the 3.15 branch. |
Sorry, something went wrong.
|
GH-155165 is a backport of this pull request to the 3.14 branch. |
Sorry, something went wrong.
…tack (GH-155120) (GH-155165) Add the @support.run_with_limited_c_stack() decorator which runs the test in a thread with a 8 MiB C stack, so that the outcome does not depend on RLIMIT_STACK. Use it in tests which recurse to a fixed depth -- @support.skip_if_huge_c_stack() failed to skip them with a 16 MiB stack. (cherry picked from commit ce5ae29) Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
…ed C stack (pythonGH-155120) (pythonGH-155165) Add the @support.run_with_limited_c_stack() decorator which runs the test in a thread with a 8 MiB C stack, so that the outcome does not depend on RLIMIT_STACK. Use it in tests which recurse to a fixed depth -- @support.skip_if_huge_c_stack() failed to skip them with a 16 MiB stack. (cherry picked from commit ce5ae29) Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
…ack (pythonGH-155120) Add the @support.run_with_limited_c_stack() decorator which runs the test in a thread with a 8 MiB C stack, so that the outcome does not depend on RLIMIT_STACK. Use it in tests which recurse to a fixed depth -- @support.skip_if_huge_c_stack() failed to skip them with a 16 MiB stack. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…tack (GH-155120) (GH-155164) Add the @support.run_with_limited_c_stack() decorator which runs the test in a thread with a 8 MiB C stack, so that the outcome does not depend on RLIMIT_STACK. Use it in tests which recurse to a fixed depth -- @support.skip_if_huge_c_stack() failed to skip them with a 16 MiB stack. (cherry picked from commit ce5ae29) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
| Back | FazBrowse Home | New Git URL |
Add the @support.run_with_limited_c_stack(depth) decorator: it runs the test in a thread with an 8 MiB C stack, so that the outcome does not depend on RLIMIT_STACK. If the thread stack size cannot be limited, it falls back to the old behavior — run in the current thread and skip if the C stack is too large.
Use it in tests which recurse to a fixed depth. @support.skip_if_huge_c_stack() estimates the remaining stack in interpreter loop frames (~328 bytes), so it fails to skip tests which recurse with much smaller C frames (~100 bytes) — they fail with a 16 MiB stack. It is kept for tests with unbounded recursion and for test_call.test_super_deep(), which needs a deep stack.
Tested on Linux with 1, 8, 16, 32 and 512 MiB and unlimited stack limits, and on illumos and OpenBSD.