[SciPy-Dev] segfault from scipy.io.netcdf with scipy-0.14 numpy-0.18

Robert McGibbon rmcgibbo at gmail.com
Thu May 8 18:17:21 EDT 2014


Thanks for the tips, all. I've posted a
PR<https://github.com/scipy/scipy/pull/3633>
.

-Robert


On Thu, May 8, 2014 at 7:12 AM, Jonathan Helmus <jjhelmus at gmail.com> wrote:

>  On 05/08/2014 07:44 AM, Charles R Harris wrote:
>
>
>
>
> On Thu, May 8, 2014 at 4:17 AM, Robert McGibbon <rmcgibbo at gmail.com>wrote:
>
>> fwiw, I did a bisect, and the problem comes at scipy
>> 2dfffc7beeb924d6aa5e6529f25745c5330a7bac.
>>
>>
>  You should open a scipy issue for this, or at least post to the scipy
> list.
>
>  Chuck
>
>
> _______________________________________________
> SciPy-Dev mailing listSciPy-Dev at scipy.orghttp://mail.scipy.org/mailman/listinfo/scipy-dev
>
>
> It looks like the netcdf_file.close() method is called and closes the mmap
> without checking to see if an ndarray is still backed by that mmap.
> Accessing that mmapped ndarray causes the segmentation fault.  A more
> detailed example which segmentation faults on all netCDF files I've tried
> is:
>
> import scipy.io
> f = scipy.io.netcdf.netcdf_file('mdcrd.nc', mmap=True)
> v = f.variables['coordinates']
> print v[:].sum()
> f.close()
> print v[:].sum()    # segmentation fails since mmap backing v is closed
>
> If you change the first line to mmap=False the script runs fine.
>
> I can generated a backtrace it would be helpful, but the offending lines
> are 234 and 235 in scipy/io/netcdf.py [1]
>
> Cheers,
>
>     - Jonathan Helmus
>
> [1]
> https://github.com/scipy/scipy/blob/2dfffc7beeb924d6aa5e6529f25745c5330a7bac/scipy/io/netcdf.py#L234
>
> _______________________________________________
> SciPy-Dev mailing list
> SciPy-Dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20140508/e307d894/attachment.html>


More information about the SciPy-Dev mailing list