GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||
GeezerVison is showing github.com — BUG: fix out array leak in reduceat and accumulate when dtype resolution fails by ikrommyd · Pull Request #31699 · numpy/numpy Conversation
Member
Closes #31691 PR summaryIn both of those cases >>> import sys, numpy as np ... arr = np.arange(3) ... out = np.empty(3, dtype="U5") ... ... before = sys.getrefcount(out) ... for _ in range(10000): ... try: ... np.add.accumulate(arr, out=out) ... except Exception: ... pass ... print(sys.getrefcount(out) - before) ... 10000 # with the fix, we get 0 here Let me know if you think the above should be added as a test. I found it a trivial fix and not worthy of a specialized test personally. First time committer introductionN/A AI DisclosureNo AI
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions…ion fails Signed-off-by: Iason Krommydas <[email protected]>
MaanasArora
approved these changes
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, LGTM! (All other returns goto Pretty sure we don't need a test for this as well!
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Contributor
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
seberg
approved these changes
Member
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Contributor
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
|
There was an error while loading. Please reload this page.
|
LMK if what I added is what you had in mind. Indeed I wouldn't assert on the ref count either cause I think I've had cases in the past where a change in python version causes ref count assertions to fail in tests. Edit: the linting failure is not in code I'm touching here? What? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Thanks, sorry for being obnoxious about adding tests :).
The lint failure, I'll ignore it: Not quite sure but the cython lint may be running process wide and maybe they had a release or so? (We'll have to fix it if it shows up generally, though.)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
#31711 I think Joren's on it. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
…ion fails (#31699) Signed-off-by: Iason Krommydas <[email protected]>
BUG: fix out array leak in reduceat and accumulate when dtype resolution fails (#31699)
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
BUG: out reference leak in PyUFunc_Accumulate and PyUFunc_Reduceat on type resolution failure
There was an error while loading. Please reload this page.