-
-
Notifications
You must be signed in to change notification settings - Fork 11.1k
BUG: Fix leak in the f2py-generated module init and PyMem_Del
usage
#14217
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
Conversation
There are a bunch of similar ones, see gh-12633. Unfortunately, there seems to be some issue/interaction with Python 3.5 (possibly a bug), which means that we could never merge those fixes. It seems that this one strikes the same issue. If you have any idea if/how to circumvent that, that would be awesome. |
As an extra twist, the leak is only detected on Python 3.6 (and potentially other 3.X versions) and not on 2.X. We are using an older NumPy version internally but that part is unchanged from the current |
46382be
to
6d1ea92
Compare
Maybe the whole fix has to be applied only to |
Oh, so you found the work around that works on all python versions already? That is awesome, should we continue my old PR? I would could give you access to that branch. |
I haven't tested locally on anything other than Python 3.5 and 3.6, but Azure covers 3.7 as well, right? Feel free to include the |
I don't care too much either way. I already did that, but my PR is a bit larger (and thus review might be a bit slower). So after some thought I would also be happy to just merge this and rebase mine on top. I assume this is something you actually notice, so fixing it a bit faster may be good. |
@seberg Ping. |
Ah, I forgot this over my gh-12633, but I can fix this up and merge it tomorrow or so. |
Using `PyMem_Del` is incorrect, it should be `PyObject_Del` here, while this worked most of the time, it would lead to crashes at least on python 2.5 (after the reference counts were fixed)
Removed incorrect files, and changed it to |
Had to restart the PyPy test here (hanging process), just noting. |
PyMem_Del
usage
The leak is fairly innocent as the created Fortran objects are referenced from the module globals and therefore are only GCed on module reload/interpreter shutdown.