Skip to content

BUG: fix datetime/timedelta hash memory leak #29411

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 24, 2025

Conversation

kostayScr
Copy link
Contributor

Fixes lack of a Py_DECREF() call in the datetime/timdelta hash function. Closes #29397.

@ngoldbaum ngoldbaum added the 09 - Backport-Candidate PRs tagged should be backported label Jul 22, 2025
Copy link
Member

@ngoldbaum ngoldbaum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed some preexisting issues with error handling and suggested a fix.

Also ping @walshb - FYI there were some error checking and reference counting bugs that were missed in the datetime/timedelta hash PR we merged last year.

@ngoldbaum ngoldbaum added this to the 2.3.2 release milestone Jul 23, 2025
@melissawm melissawm moved this to Pending authors' response in NumPy first-time contributor PRs Jul 23, 2025
kostayScr and others added 3 commits July 24, 2025 16:56
Co-authored-by: Nathan Goldbaum <nathan.goldbaum@gmail.com>
Co-authored-by: Nathan Goldbaum <nathan.goldbaum@gmail.com>
@kostayScr
Copy link
Contributor Author

Seems to be in order.

@ngoldbaum
Copy link
Member

Thanks for closing the loop on this @kostayScr. This will be backported to the 2.3 release branch and will be included in NumPy 2.3.2.

@ngoldbaum ngoldbaum merged commit 439f763 into numpy:main Jul 24, 2025
76 checks passed
@github-project-automation github-project-automation bot moved this from Pending authors' response to Completed in NumPy first-time contributor PRs Jul 24, 2025
charris pushed a commit to charris/numpy that referenced this pull request Jul 24, 2025
* BUG: fix datetime/timedelta hash memory leak

* get metadata directly from scalar object

Co-authored-by: Nathan Goldbaum <nathan.goldbaum@gmail.com>

* BUG: remove unnecessary Py_DECREF

Co-authored-by: Nathan Goldbaum <nathan.goldbaum@gmail.com>

* BUG: remove dtype variable declaration that is not used anymore

---------

Co-authored-by: Nathan Goldbaum <nathan.goldbaum@gmail.com>
@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Jul 24, 2025
charris added a commit that referenced this pull request Jul 24, 2025
BUG: fix datetime/timedelta hash memory leak (#29411)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging this pull request may close these issues.

BUG: Memory leak calling hash() on np.datetime64 object
5 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy