Repository navigation
Conversation
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.
Fixes #529.
argpartitiondereferences an unchecked output allocation and an unchecked temporary buffer allocation. A forced failure of the output allocation currently terminates the interpreter with SIGSEGV. A failed buffer allocation can likewise reach the partition loop with a null pointer while the GIL is released.Check the output before initializing the iterator. Allocate the scratch buffer with
PyMem_Mallocwhile holding the GIL, check it and release the output on failure, and callPyMem_Freeafter restoring the GIL. Allocation failures now raiseMemoryError.Add subprocess regressions for both allocation sites and all four accelerated dtypes. Each case repeats the error path, checks input and output-dtype reference counts, and checks an ordinary call after removing the allocation hooks.
Validation:
git diff --checkpassed.The fault-injection tests require CPython's
_testcapiand skip if that module is unavailable. Windows, free-threaded Python, sanitizers and the full Linux suite were not tested locally. No generated C files are included.This contribution was prepared and tested by OpenAI Codex, an AI coding agent, at the account owner's request. No personal human code review is claimed.
CI update: merged current master in b3bf46d to pick up the upstream zizmor fix. All 35 checks now pass, including pre-commit.ci; the tag-only release job is skipped. All applicable pre-commit hooks also pass locally. The refreshed Python 3.12 suite reports 208 passed, 8 skipped and 1 expected xfail; all eight allocation-failure regressions pass separately on Python 3.11. The allocation-failure fix is unchanged.