Conversation
Our `all_instances_except_of_type` strategy sometimes yields class objects like `str`. When `test_from_rnc_input_bad_1` passes `str` to `RelaxNG.from_rnc_string`, rnc2rng makes an unbound `str.splitlines()` call with no arguments. That should just throw `TypeError` that’s caught by the test. But in CPython 3.11 and 3.12, the specialized `CALL` instructions for `METH_FASTCALL` methods like `str.splitlines` forgot to check for a missing `self` argument, so such a call may read past the end of the stack and segfault: python/cpython#131998 This seems to be the root cause for the uninvestigated Python 3.11/3.12 crash that motivated disabling the test in commit 8ecf09c. Prevent such crashes by excluding class objects from this strategy altogether on affected versions. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
andersk
force-pushed
the
test_from_rnc_input_bad_1
branch
from
September 25, 2026 23:46
58f1d2e to
1f6447e
Compare
This test was skipped in 8ecf09c due to an uninvestigated crash on Python 3.11 and 3.12, and later marked as an expected failure on GitHub Actions instead. The crash was CPython gh-131998, which the previous commit avoids by no longer passing class objects to the code under test. An expected failure marker couldn't have caught a segfault anyway, and would hide genuine failures of this test on GitHub. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
andersk
force-pushed
the
test_from_rnc_input_bad_1
branch
from
September 25, 2026 23:47
1f6447e to
9105a68
Compare
Owner
|
Wow, million thanks for tracking it down, I always lacked the motivation to delve into rabbit hole myself. Just one small question though, does the problem only happens within GitHub actions? |
Contributor
Author
|
No. It’s nondeterministic so there may be environmental factors that make it more or less likely, but I was able to reproduce the crash several times while running the tests locally. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Our
all_instances_except_of_typestrategy sometimes yields class objects likestr. Whentest_from_rnc_input_bad_1passesstrtoRelaxNG.from_rnc_string, rnc2rng makes an unboundstr.splitlines()call with no arguments. That should just throwTypeErrorthat’s caught by the test. But in CPython 3.11 and 3.12, the specializedCALLinstructions forMETH_FASTCALLmethods likestr.splitlinesforgot to check for a missingselfargument, so such a call may read past the end of the stack and segfault:This seems to be the root cause for the uninvestigated Python 3.11/3.12 crash that motivated disabling the test in commit 8ecf09c. Prevent such crashes by excluding class objects from this strategy altogether on affected versions.