You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
skip_if_huge_c_stack underestimates available C recursion depth #155109
Hi! With the recent merge of #154277, we started seeing test_parameters_deep_recursion failure on Solaris; and I believe that the reason for this failure is an insufficient heuristic in the skip_if_huge_c_stack decorator.
On Solaris, we run the tests with 16 MiB stacks (rather than widely used 8MiB). At this stack size, the test fails with:
======================================================================
FAIL: test_parameters_deep_recursion (test.test_typing.GenericTests.test_parameters_deep_recursion)
----------------------------------------------------------------------
Traceback (most recent call last):
File "..../Lib/test/test_typing.py", line 4939, in test_parameters_deep_recursion
withself.assertRaisesRegex(RecursionError, "in __parameter__ calculation"):
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: RecursionError not raised
From my testing, 14 MiB and above causes the failure on Intel, and 32 MiB and above on SPARC (different frame sizes result in different thresholds).
I used a GitHub action with ubuntu-24.04 os to test this on Linux, and it fails there as well at 20MiB+.
BTW, on MacOS, it always passes - either the heuristic works good there, or the stack handling works differently than on other platforms where I tested it (I did not investigate that further).
Activity
StanFromIreland commentedon Aug 3, 2026
Possibly related: #155103
Merge branch 'main' of https://github.com/python/cpython into pythong…
gh-155109: Run tests exhausting the C stack with a limited C stack (G…
[3.14] gh-155109: Run tests exhausting the C stack with a limited C s…
[3.14] pythongh-155109: Run tests exhausting the C stack with a limit…
test_parameters_deep_recursionfailed on the free-threading CI job #155103 as a duplicate of this issuepythongh-155109: Run tests exhausting the C stack with a limited C st…
[3.15] gh-155109: Run tests exhausting the C stack with a limited C s…