-
-
Notifications
You must be signed in to change notification settings - Fork 34.1k
Description
Bug report
Bug description:
I had the same experience with this bug as with a compiler bug: I first suspected and debugged everything else than cpython. But:
-
I could really not find anything wrong anywhere else
-
The
cpythonbisect unambiguously and deterministically points to this 3.13.8 backport
ebccd1de88d. All 3.13 git commits before that backport pass, all 3.13 versions after this backport fail. -
cpython 3.14 with the original gh-132744: Check recursion limit in _PY_FRAME_GENERAL #132746 works fine. Maybe the 3.13.8 backport is missing some subtle dependency found only in 3.14? EDIT: confirmed below.
-
The behavior is the same across Windows, Linux and macOS:
test_manifest.py: parametrize loop_detection test for more coverage zephyrproject-rtos/west#919 (comment) -
Reverting the 3.13.8 backport makes all failing test configurations pass again:
cd cpython git checkout v3.13.12 git revert ebccd1de88d4 # surprisingly zero conflict -
Explain this?
sys.setrecursionlimit(1000) # PASS
sys.setrecursionlimit(1001) # FAIL
sys.setrecursionlimit(1002) # PASS
sys.setrecursionlimit(1003) # FAIL
sys.setrecursionlimit(1004) # PASS
sys.setrecursionlimit(1005) # FAIL
- While it's not clear to me why some test configurations fails and others do not, the
corruption that seems to be happening is 100% deterministic. When a test configuration fails,
then it fails 100% of the time. Test configurations that pass, pass 100% of the time.
So, I really think this is a cpython issue now.
Simple and short reproduction steps simplified from all the trial and error in zephyrproject-rtos/west#908
git clone https://github.com/zephyrproject-rtos/west
cd west
git checkout 2d883de32f4f # today's latest version
# You MUST turn off the @pytest.mark.skipif((3, 13, 8) <= sys.version_info) I had to add in test_manifest.py not to break CI.
# See where in https://github.com/zephyrproject-rtos/west/pull/919#issuecomment-3900130946
uv python install 3.12 3.13.7 3.13.8 3.13.12 3.14
for i in 3.12 3.13.7 3.13.8 3.13.12 3.14; do
uv run --python "$i" pytest -k loop_detect
done
Versions from 3.13.8 to 3.13.12 FAIL odd recursion limits. All other Python versions pass.
The test fails with a very long (by design) stack trace seen here:
zephyrproject-rtos/west#908 (comment)
Then, the last frames of the stack observed with pytest --pdb makes no sense:
- The
srp()method (Stream Reader.peek()) is called without any parameter - Its default
indexargument isindex : int = 0 - Inside the
peek()method, theindex: intparameter becomes equal to...self!!
def peek(self, index: int = 0) -> Text:
(Pdb) p self
<ruamel.yaml.reader.Reader object at 0x7ff5ed1b9010>
(Pdb) p index
<ruamel.yaml.reader.Reader object at 0x7ff5ed1b9010> # !!!!!
CPython versions tested on:
3.13
Operating systems tested on:
Linux, Windows, macOS
Linked PRs
Metadata
Metadata
Assignees
Labels
Projects
Status