-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
"import numpy" leaks memory (again) #12615
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
Comments
For comparison, |
Does master show the same problem? 1.15.1 - 1.15.4 is already a pretty narrow range to bisect - thanks! |
Hmm, I see the second one (and many like it), but it is in mtrand probably, so it could be cython as well (did we change the cython version for some reason between those releases)? Running on master, I further see a couple to do with ufunc adding, at least for the linalg ones:
EDIT: This is master with cython 0.29 |
Cython should be fixed at 0.28.5 for Linux in the 1.15 series of wheels, although it hard to be sure. Windows looks like it uses the most recent. I don't recall what the source releases used, but would suspect they are the same. Would the Cython version be part of the generated code? @skrah Where did you get numpy. If you built it yourself, what Cython version? |
It would be great if we could catch this in CI |
There is this linked in the old issue: twmr@ec7b73f although maybe it would be better to do it outside our testsuit. |
I will post a patch for the ufunc leak, but the original one, I did not check further. |
So for the other
the code works fine, but seems like it generates the same thing twice or so? |
Ahh, this occurs for identical errors being given in multiple places (so the error string – and type – is identical). I will open a cython issue, lets see if that is it. EDIT: Tthe cython bug I saw was already known and fixed in 0.29.2. |
I checked out numpy So the future looks bright. :) The leaks I had were in the release tarball |
One more thing to wait on for 1.16.0 :( |
Looks like Cython 0.29.2 also fixes the problem. cython/cython#2768. |
Should we add this to the test suit/as a special test? I guess we can really add it to the test suite if we mark it as slow. It would be good to write it in a way so that adding a bit more code than only the import is easy (although running a lot of code in valgrind is slow). I also ran the whole test suit through the memory lost checker (did valgrind often, but not with that), will sieve through it, I think it exposed at least one bug. |
It would be useful to have an easy way to run the check. Perhaps an option added to |
Yeah, maybe that is the best version. I see quite a few lost Dtype/descriptors in valgrind. I think running a refcount checker may be a good idea (and give a better idea where things go wrong). EDIT: Found the issue (or probably, didn't rerun the full test suit). |
@skrah thanks for the heads up. I think the numpy test suit now runs cleanly with the exception of There are still one or two points that are flaky or I do not quite understand, but I think they are not real leaks anyway. Using a debug python build and a refcount tester may be a next step in the future. |
Uh oh!
There was an error while loading. Please reload this page.
The leaks in #10157 were fixed, but it looks as if there are new ones. The second one (or both) could also be Cython issues. The leaks show up by just importing numpy, without doing anything else.
The text was updated successfully, but these errors were encountered: