Skip to content

blacklist _testmultiphase.call_state_registration_func (raises SystemError by design) - #260

Merged
devdanzin merged 1 commit into
mainfrom
testmultiphase-state-func
Aug 18, 2026
Merged

blacklist _testmultiphase.call_state_registration_func (raises SystemError by design)#260
devdanzin merged 1 commit into
mainfrom
testmultiphase-state-func

Conversation

@devdanzin

Copy link
Copy Markdown
Owner

Third noise source from the PyPy stdlib fleet triage (after #259).

_testmultiphase.call_state_registration_func() exists to prove the error path: it calls
PyState_AddModule / PyState_RemoveModule on a multi-phase-init module, which is defined
to raise SystemError — a 1.0 crash word.

Verified identical on both interpreters:

CPython 3.14:  call_state_registration_func(1) -> SystemError: PyState_AddModule called on module with slots
               call_state_registration_func(2) -> SystemError: PyState_RemoveModule called on module with slots
PyPy 7.3.23:   same, via cpyext

So it's a guaranteed false positive anywhere, not a PyPy quirk. It kept 11 dirs in one
fleet.

Why the function and not the module

_testcapi / _testinternalcapi / _testlimitedcapi are blacklisted wholesale, but
_testmultiphase shouldn't be: foo, Example and Str are real multi-phase-init surface
worth fuzzing, and on PyPy the whole module runs through cpyext, the C-API emulation
layer — the most interesting target that interpreter has. Measured over the fleet, only
call_state_registration_func produces the SystemError; foo (387 calls), Example (216)
and Str (200) were all clean.

The test pins both halves: the function is blacklisted, the module is not, and the three
useful names stay fuzzable.

Full suite green (1255); ruff clean.

🤖 Generated with Claude Code

…Error by design)

The function exists to prove the error path: it calls PyState_AddModule /
PyState_RemoveModule on a multi-phase-init module, which is defined to raise SystemError --
a 1.0 crash word. Verified identical on CPython 3.14 and on PyPy 7.3.23's cpyext, so it is
a guaranteed false positive on any interpreter. It kept 11 dirs in one PyPy stdlib fleet.

Only the function is blacklisted, not the module (unlike _testcapi and friends): the rest
of _testmultiphase -- foo, Example, Str -- is real multi-phase-init surface worth fuzzing,
and on PyPy it exercises the cpyext C-API emulation layer, which is the most interesting
target that interpreter has.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WhcpLoyjUWLbETGZnA9boj
@devdanzin
devdanzin merged commit 9b91aea into main Aug 18, 2026
1 of 2 checks passed
@devdanzin
devdanzin deleted the testmultiphase-state-func branch August 18, 2026 23:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant