[SciPy-Dev] netcdf segfault

Benjamin Root ben.root@ou....
Mon Jun 14 20:43:55 CDT 2010


I was trying out the scipy.io.netcdf module in order to work on the
documentation and I came across a way to segfault out of python.  If you
open an existing netcdf file as read-only and then try to set a scalar value
using .assignValue for a 1-element netcdf_variable, the program segfaults
rather than raising an exception.

Here is an example to go with a very small netcdf file as a test:

from scipy.io import netcdf
f = netcdf.netcdf_file("testdata.netcdf", 'r')
tval = f.variables['t']

Ben Root
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-dev/attachments/20100614/d2cfc30a/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: testdata.nc
Type: application/x-netcdf
Size: 84 bytes
Desc: not available
Url : http://mail.scipy.org/pipermail/scipy-dev/attachments/20100614/d2cfc30a/attachment.nc 

More information about the SciPy-Dev mailing list