[NumPy-Tickets] [NumPy] #1370: numpy.load() crashes on invalid data
NumPy Trac
numpy-tickets@scipy....
Thu Jan 21 17:09:39 CST 2010
#1370: numpy.load() crashes on invalid data
------------------------+---------------------------------------------------
Reporter: dhelfman | Owner: somebody
Type: defect | Status: new
Priority: normal | Milestone: 1.5.0
Component: numpy.core | Version: 1.4.0
Keywords: |
------------------------+---------------------------------------------------
{{{
>>> import cStringIO as io
>>> import numpy as np
>>> np.load( io.StringIO( '0' ) )
}}}
When I run this, the Python interpreter crashes and exits unceremoniously.
Note that if I change the '0' to a '1', I get a proper IOError exception
and no crash.
This is in MSYS on Windows XP with Python 2.6.4 from python.org, running
numpy 1.4.0 built with MSVC 9.0:
{{{
$ gdb python
GNU gdb 5.2.1
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for
details.
This GDB was configured as "i686-pc-mingw32"...(no debugging symbols
found)...
(gdb) r -c "import cStringIO as IO ; import numpy as np ; np.load(
IO.StringIO('0') )"
Starting program: c:\python26/python.exe -c "import cStringIO as io ;
import numpy as np ; np.load( io.StringIO('0') )"
Program received signal SIGSEGV, Segmentation fault.
0x1e09ada3 in ?? ()
(gdb) bt
#0 0x1e09ada3 in ?? ()
#1 0x1e0e1fd5 in ?? ()
#2 0x00a4e530 in ?? ()
#3 0x1e1d1d30 in ?? ()
Cannot access memory at address 0x5
}}}
And this is on Mac OS X 10.4 with Python 2.6.4 from python.org, running
numpy 1.4.0 built with gcc 4.0.1 from Apple:
{{{
$ gdb python
GNU gdb 5.2.1
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for
details.
This GDB was configured as "i686-pc-mingw32"...(no debugging symbols
found)...
(gdb) r -c "import cStringIO as IO ; import numpy as np ; np.load(
IO.StringIO('0') )"
Starting program: c:\python26/python.exe -c "import cStringIO as IO ;
import numpy as np ; np.load( IO.StringIO('0') )"
Program received signal SIGSEGV, Segmentation fault.
0x1e09ada3 in ?? ()
(gdb) bt
#0 0x1e09ada3 in ?? ()
#1 0x1e0e1fd5 in ?? ()
#2 0x00a4e530 in ?? ()
#3 0x1e1d1d30 in ?? ()
Cannot access memory at address 0x5
}}}
--
Ticket URL: <http://projects.scipy.org/numpy/ticket/1370>
NumPy <http://projects.scipy.org/numpy>
My example project
More information about the NumPy-Tickets
mailing list