Thanks to visit codestin.com
Credit goes to github.com

Skip to content

BUG: Fix refcounting in ufunc object loops #15036

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 1 commit into from
Dec 3, 2019
Merged

Conversation

eric-wieser
Copy link
Member

@eric-wieser eric-wieser commented Dec 3, 2019

Previously func was leaked on both success and failure paths.

Fixes #14950, hopefully.

This was introduced in #12700, so needs a backport to 1.17, probably. You can create one by clicking this link.

@eric-wieser eric-wieser added this to the 1.18.0 release milestone Dec 3, 2019
Previously `func` was leaked on both success and failure paths.
@mattip
Copy link
Member

mattip commented Dec 3, 2019

@seberg had a script that could check for leaks with a debug build of python. I wonder why it didn't catch this one. Is this path tested?

@eric-wieser
Copy link
Member Author

Is this path tested?

At least to some extent, yes - before my force push, tests failed.

@mattip
Copy link
Member

mattip commented Dec 3, 2019

Nice catch @eric-wieser. The original code leaked a reference, sorry. Merging.

@mattip mattip merged commit e39aa70 into numpy:master Dec 3, 2019
@eric-wieser
Copy link
Member Author

The original code leaked a reference, sorry.

No need to apologies, I approved the original code too!

@seberg
Copy link
Member

seberg commented Dec 3, 2019

@mattip yes, I was checking this. I do not have a script it is pytest-leaks plugin. And it runs the whole test suit fine with only minor things. It would seem that this path does not have test coverage. (I just ran the whole test suit yesterday, and I think all are known ­– fairly harmless – leaks (f2py/distutils compilation, things that have to leak and one tiny leak in ufunc.at).

@seberg
Copy link
Member

seberg commented Dec 3, 2019

Hmmm, the test seems like it actually does pick it up even before. I might have misremembered the single failure in the ufunc tests. Anyway, some additional tests coming up.

seberg added a commit to seberg/numpy that referenced this pull request Dec 3, 2019
These loops should give the same results as when run on the equivalent
numeric/floatingpoint values.

Adds additional tests for numpygh-15036
mattip pushed a commit that referenced this pull request Dec 4, 2019
* TST: Add test for object method (and general unary) loops

These loops should give the same results as when run on the equivalent
numeric/floatingpoint values.

Adds additional tests for gh-15036
@charris charris modified the milestones: 1.18.0 release, 1.17.5 release Dec 5, 2019
@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Dec 6, 2019
@charris charris removed this from the 1.17.5 release milestone Dec 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Memory leak when using np.conjugate() on sparse matrices.
4 participants