Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_tomllib.test_inline_array_recursion_limit() failed on wasm32-wasi 3.11 buildbot #108851

Closed
vstinner opened this issue Sep 3, 2023 · 5 comments
Labels
3.11 only security fixes OS-wasi tests Tests in the Lib/test dir

Comments

@vstinner
Copy link
Member

vstinner commented Sep 3, 2023

test_tomllib.test_inline_array_recursion_limit() failed on wasm32-wasi 3.11 buildbot:

ERROR: test_inline_array_recursion_limit (test.test_tomllib.test_misc.TestMiscellaneous.test_inline_array_recursion_limit)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Lib/test/test_tomllib/test_misc.py", line 98, in test_inline_array_recursion_limit
    tomllib.loads(recursive_array_toml)
  File "/Lib/tomllib/_parser.py", line 102, in loads
    pos = key_value_rule(src, pos, out, header, parse_float)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Lib/tomllib/_parser.py", line 326, in key_value_rule
    pos, key, value = parse_key_value_pair(src, pos, parse_float)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Lib/tomllib/_parser.py", line 369, in parse_key_value_pair
    pos, value = parse_value(src, pos, parse_float)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Lib/tomllib/_parser.py", line 616, in parse_value
    return parse_array(src, pos, parse_float)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Lib/tomllib/_parser.py", line 420, in parse_array
    pos, val = parse_value(src, pos, parse_float)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  (...)
  File "/Lib/tomllib/_parser.py", line 416, in parse_array
    pos = skip_comments_and_array_ws(src, pos)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Lib/tomllib/_parser.py", line 278, in skip_comments_and_array_ws
    pos = skip_chars(src, pos, TOML_WS_AND_NEWLINE)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RecursionError: maximum recursion depth exceeded

link: https://buildbot.python.org/all/#/builders/1047/builds/908

Linked PRs

vstinner added a commit to vstinner/cpython that referenced this issue Sep 3, 2023
Add get_recursion_available() and get_recursion_depth() functions to
the test.support module.

sys.setrecursionlimit() now allows setting the limit to the current
recursion depth.
vstinner added a commit to vstinner/cpython that referenced this issue Sep 3, 2023
Add get_recursion_available() and get_recursion_depth() functions to
the test.support module.

sys.setrecursionlimit() now allows setting the limit to the current
recursion depth.
vstinner added a commit to vstinner/cpython that referenced this issue Sep 3, 2023
Add get_recursion_available() and get_recursion_depth() functions to
the test.support module.

sys.setrecursionlimit() now allows setting the limit to the current
recursion depth.
vstinner added a commit to vstinner/cpython that referenced this issue Sep 3, 2023
* Add get_recursion_available() and get_recursion_depth() functions
  to the test.support module.
* sys.setrecursionlimit() now allows setting the limit to the current
  recursion depth.
* Fix test_tomllib recursion tests.
vstinner added a commit to vstinner/cpython that referenced this issue Sep 3, 2023
* Add get_recursion_available() and get_recursion_depth() functions
  to the test.support module.
* sys.setrecursionlimit() now allows setting the limit to the current
  recursion depth.
* Fix test_tomllib recursion tests.
vstinner added a commit to vstinner/cpython that referenced this issue Sep 3, 2023
* sys.setrecursionlimit() now allows setting the limit to the current
  recursion depth.
* Add get_recursion_available() and get_recursion_depth() functions
  to the test.support module.
* Fix test_tomllib recursion tests: reduce the limit to pass tests on
  WASI buildbots and compute the maximum nested array/dict depending
  on the current available recursion limit.
vstinner added a commit to vstinner/cpython that referenced this issue Sep 3, 2023
* sys.setrecursionlimit() now allows setting the limit to the current
  recursion depth.
* Add get_recursion_available() and get_recursion_depth() functions
  to the test.support module.
* Fix test_tomllib recursion tests: reduce the limit to fix tests on
  WASI buildbots and compute the maximum nested array/dict depending
  on the current available recursion limit.
vstinner added a commit to vstinner/cpython that referenced this issue Sep 3, 2023
* sys.setrecursionlimit() now allows setting the limit to the current
  recursion depth.
* Add get_recursion_available() and get_recursion_depth() functions
  to the test.support module.
* Change infinite_recursion() default max_depth from 75 to 100.
* Fix test_tomllib recursion tests for WASI buildbots: reduce the
  recursion limit and compute the maximum nested array/dict depending
  on the current available recursion limit.
vstinner added a commit to vstinner/cpython that referenced this issue Sep 3, 2023
* sys.setrecursionlimit() now allows setting the limit to the current
  recursion depth.
* Add get_recursion_available() and get_recursion_depth() functions
  to the test.support module.
* Change infinite_recursion() default max_depth from 75 to 100.
* Fix test_tomllib recursion tests for WASI buildbots: reduce the
  recursion limit and compute the maximum nested array/dict depending
  on the current available recursion limit.
@brettcannon brettcannon added OS-wasi tests Tests in the Lib/test dir 3.11 only security fixes labels Sep 5, 2023
vstinner added a commit to vstinner/cpython that referenced this issue Sep 5, 2023
* Add get_recursion_available() and get_recursion_depth() functions
  to the test.support module.
* Change infinite_recursion() default max_depth from 75 to 100.
* Fix test_tomllib recursion tests for WASI buildbots: reduce the
  recursion limit and compute the maximum nested array/dict depending
  on the current available recursion limit.
* test.pythoninfo logs sys.getrecursionlimit()
* Enhance test_sys tests on sys.getrecursionlimit()
  and sys.setrecursionlimit().
vstinner added a commit that referenced this issue Sep 6, 2023
* Add get_recursion_available() and get_recursion_depth() functions
  to the test.support module.
* Change infinite_recursion() default max_depth from 75 to 100.
* Fix test_tomllib recursion tests for WASI buildbots: reduce the
  recursion limit and compute the maximum nested array/dict depending
  on the current available recursion limit.
* test.pythoninfo logs sys.getrecursionlimit().
* Enhance test_sys tests on sys.getrecursionlimit()
  and sys.setrecursionlimit().
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Sep 6, 2023
* Add get_recursion_available() and get_recursion_depth() functions
  to the test.support module.
* Change infinite_recursion() default max_depth from 75 to 100.
* Fix test_tomllib recursion tests for WASI buildbots: reduce the
  recursion limit and compute the maximum nested array/dict depending
  on the current available recursion limit.
* test.pythoninfo logs sys.getrecursionlimit().
* Enhance test_sys tests on sys.getrecursionlimit()
  and sys.setrecursionlimit().
(cherry picked from commit 8ff1142)

Co-authored-by: Victor Stinner <[email protected]>
vstinner added a commit to vstinner/cpython that referenced this issue Sep 6, 2023
* Add get_recursion_available() and get_recursion_depth() functions
  to the test.support module.
* Change infinite_recursion() default max_depth from 75 to 100.
* Fix test_tomllib recursion tests for WASI buildbots: reduce the
  recursion limit and compute the maximum nested array/dict depending
  on the current available recursion limit.
* test.pythoninfo logs sys.getrecursionlimit().
* Enhance test_sys tests on sys.getrecursionlimit()
  and sys.setrecursionlimit().

Backport notes:

* Set support.infinite_recursion() minimumum to 4 frames.
* test_support.test_get_recursion_depth() uses limit-2, apparently
  f-string counts for 2 frames in Python 3.11.
* test_sys.test_setrecursionlimit_to_depth() tests depth+2 instead of
  depth+1.

(cherry picked from commit 8ff1142)
vstinner added a commit to vstinner/cpython that referenced this issue Sep 6, 2023
* Add get_recursion_available() and get_recursion_depth() functions
  to the test.support module.
* Change infinite_recursion() default max_depth from 75 to 100.
* Fix test_tomllib recursion tests for WASI buildbots: reduce the
  recursion limit and compute the maximum nested array/dict depending
  on the current available recursion limit.
* test.pythoninfo logs sys.getrecursionlimit().
* Enhance test_sys tests on sys.getrecursionlimit()
  and sys.setrecursionlimit().

Backport notes:

* Set support.infinite_recursion() minimum to 4 frames.
* test_support.test_get_recursion_depth() uses limit-2, apparently
  f-string counts for 2 frames in Python 3.11.
* test_sys.test_setrecursionlimit_to_depth() tests depth+2 instead of
  depth+1.

(cherry picked from commit 8ff1142)
@vstinner vstinner closed this as completed Sep 6, 2023
vstinner added a commit that referenced this issue Sep 6, 2023
gh-108851: Fix tomllib recursion tests (#108853)

* Add get_recursion_available() and get_recursion_depth() functions
  to the test.support module.
* Change infinite_recursion() default max_depth from 75 to 100.
* Fix test_tomllib recursion tests for WASI buildbots: reduce the
  recursion limit and compute the maximum nested array/dict depending
  on the current available recursion limit.
* test.pythoninfo logs sys.getrecursionlimit().
* Enhance test_sys tests on sys.getrecursionlimit()
  and sys.setrecursionlimit().

Backport notes:

* Set support.infinite_recursion() minimum to 4 frames.
* test_support.test_get_recursion_depth() uses limit-2, apparently
  f-string counts for 2 frames in Python 3.11.
* test_sys.test_setrecursionlimit_to_depth() tests depth+2 instead of
  depth+1.

(cherry picked from commit 8ff1142)
Yhg1s pushed a commit that referenced this issue Sep 8, 2023
gh-108851: Fix tomllib recursion tests (GH-108853)

* Add get_recursion_available() and get_recursion_depth() functions
  to the test.support module.
* Change infinite_recursion() default max_depth from 75 to 100.
* Fix test_tomllib recursion tests for WASI buildbots: reduce the
  recursion limit and compute the maximum nested array/dict depending
  on the current available recursion limit.
* test.pythoninfo logs sys.getrecursionlimit().
* Enhance test_sys tests on sys.getrecursionlimit()
  and sys.setrecursionlimit().
(cherry picked from commit 8ff1142)

Co-authored-by: Victor Stinner <[email protected]>
vstinner added a commit to vstinner/cpython that referenced this issue Sep 29, 2023
…HECK

USE_STACKCHECK on using on Windows 32-bit.
vstinner added a commit that referenced this issue Sep 29, 2023
…CHECK (#110127)

Add _testcapi.USE_STACKCHECK.

USE_STACKCHECK on using on Windows 32-bit.
@markshannon
Copy link
Member

I don't understand what's going on here.
Why does the test fail?
Hacking the tests does not seem to be the right solution. Why not fix the underlying problem, or at least triage it first?

@markshannon markshannon reopened this Nov 18, 2023
@markshannon
Copy link
Member

My mistake. I didn't see the all important 3.11 part.
Still, we ought to record what the problem is on the issue, before fixing it.

@markshannon
Copy link
Member

So, why change 3.13 and 3.12, if this is a 3.11 issue?

@markshannon markshannon reopened this Nov 18, 2023
@vstinner
Copy link
Member Author

So, why change 3.13 and 3.12, if this is a 3.11 issue?

First I saw the issue on 3.11, but in fact the 3 branches were affectected: 3.11, 3.12 and main.

@markshannon: Did you reopen the issue because you want to make changes?

@brettcannon
Copy link
Member

Since all the buildbots are passing, I'm closing the issue as fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.11 only security fixes OS-wasi tests Tests in the Lib/test dir
Projects
None yet
Development

No branches or pull requests

3 participants