FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

`skip_if_huge_c_stack` underestimates available C recursion depth · Issue #155109 · python/cpython · GitHub

Repository navigation

skip_if_huge_c_stack underestimates available C recursion depth #155109

Description

Bug report

Bug description:

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
     with self.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).

CPython versions tested on:

CPython main branch

Operating systems tested on:

Other

Linked PRs

Activity

  1. StanFromIreland commented on Aug 3, 2026

    Member

    Possibly related: #155103

  2. added 3 commits that reference this issue on Aug 4, 2026
  3. added a commit that references this issue on Aug 5, 2026
  4. added a commit that references this issue on Aug 14, 2026
  5. added a commit that references this issue on Oct 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

testsTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or error

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


    Back | FazBrowse Home | New Git URL