-
Notifications
You must be signed in to change notification settings - Fork 262
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
segfault in filepath Dataset method on some platforms #506
Comments
@jswhit bare in mind that the issue surfaces under a very specific condition: packaging with conda using while using an old GLIBC (CentOS6). I cannot reproduce that problem in a modern Linux distro (recent GLIBC). (The reason why we build conda packages with an old CentOS is to ensure compatibility across all GLIBC versions.) |
@ocefpaf, would you mind printing out the value of pathlen, right after the first call to nc_inq_path? |
( |
@ocefpaf: I've updated netCDF4.pxi and _netCDF4.pyx to use malloc and free imported from cython (which I believe allocates memory on the python heap) instead of using the libc version directly (pull request #507). I've also added some exception handling to allow it to fail more gracefully if it can't allocate the memory for the filepath pointer. Hopefully this helps. |
according to @ocefpaf, the segfault still occurs on CentOS6. I'm out of ideas at this point. |
Sorry I cannot by of more help. I do not know the first thing about C and cython. Here are the Linux build logs: https://circleci.com/gh/conda-forge/staged-recipes/151 @pelson any ideas? |
Might make sense to be able to reproduce quickly with just a docker image and a few commands... There is nothing worse than not being able to recreate an issue yourself, and it makes sense to be able to use pdb etc to track things down. |
I'm going to go ahead and merge the pull request, since it should prevent memory leakage, even if it doesn't fix the segfaults. Seems likely that the segfault is coming from either a bug in the netcdf c-lib, or the old glibc. |
I was putting together a
I have no idea what is going on! Also, at least so far, the problem seems to be relate only to the URL I used for testing. Thanks @jswhit for looking into this. I believe it is not worth try to fix this unless we find more failing cases. |
reported by @ocefpaf, see conda-forge/staged-recipes#43
Can be triggered (on some platforms) with
Reverting filepath to the version in 1.2.1 with this patch fixes it
However, I would rather not to do this since it will truncate paths longer than NC_MAX_NAME+1.
The text was updated successfully, but these errors were encountered: