Skip to content

BUG: reference leak in simd_sequence_from_iterable (#32038) - #32121

Merged
charris merged 1 commit into
numpy:maintenance/2.5.xfrom
charris:backport-32038
Jul 27, 2026
Merged

BUG: reference leak in simd_sequence_from_iterable (#32038)#32121
charris merged 1 commit into
numpy:maintenance/2.5.xfrom
charris:backport-32038

Conversation

@charris

@charris charris commented Jul 27, 2026

Copy link
Copy Markdown
Member

Backport of #32038.

PR summary

simd_sequence_from_iterable leaked the PySequence_Fast result when simd_sequence_new failed: the min-size path already Py_DECREFd, the OOM path did not. Add the missing Py_DECREF.

No new test; the leak only runs on allocation failure, which we cannot force from Python. Same approach as #31968 (no getrefcount asserts).

No release note (internal leak; no API change).

First time committer introduction

Exploring NumPy and submitting small correctness fixes (e.g. #31968).

AI Disclosure

AI helped locate and draft the fix. Human-reviewed and submitted by a human.

Signed-off-by: Abhijeetsingh Meena <abhijeet040403@gmail.com>
@charris charris added this to the 2.5.2 release milestone Jul 27, 2026
@charris charris added 00 - Bug 08 - Backport Used to tag backport PRs labels Jul 27, 2026
@charris
charris merged commit 3dc5478 into numpy:maintenance/2.5.x Jul 27, 2026
85 checks passed
@charris
charris deleted the backport-32038 branch July 27, 2026 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

00 - Bug 08 - Backport Used to tag backport PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants