GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — BUG: fix two possible crashes in the ufunc.accumulate implementation (#32545) by charris · Pull Request #32709 · numpy/numpy

Conversation

@charris

@charris charris commented Sep 20, 2026

Copy link
Copy Markdown
Member

Backport of #32545.

PR summary

It's possible to crash ufunc.accumulate by passing an out array that does not match the shape of the input. The fix for that is to check the out shape before relying on it matching.

It's also possible to trigger a read of uninitialized memory while constructing the error for e.g. np.array(b"1").cumsum(dtype="timedelta64[D]", out=np.empty(1)). The fix is to zero-initialize the out_dtypes array.

Also adds new tests for these cases.

AI Disclosure

I triggered crashes related to this during AI-assisted code review. It is not terribly likely for a user to hit these in the real world but I figure it's worth fixing.

I used an AI model to iterate on and review the correctness of the fixes and help write the tests.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@ngoldbaum @charris
BUG: fix two possible crashes in the ufunc.accumulate implementation (n…
bf48bff
…umpy#32545)
@charris charris added this to the 2.5.4 release milestone Sep 20, 2026
@charris charris added 00 - Bug 08 - Backport Used to tag backport PRs labels Sep 20, 2026
@charris
charris merged commit 453ecaf into numpy:maintenance/2.5.x Sep 20, 2026
84 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@charris
charris deleted the backport-32545 branch September 20, 2026 20:20
@zaidasar0-cloud

zaidasar0-cloud commented Sep 26, 2026

Copy link
Copy Markdown

Good

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

00 - Bug 08 - Backport Used to tag backport PRs

Projects

None yet

Milestone

2.5.4 release

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@charris @zaidasar0-cloud @ngoldbaum
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.