[Numpy-tickets] [NumPy] #614: SegFault/double free with simple array mask operation

NumPy numpy-tickets@scipy....
Thu Nov 15 01:21:19 CST 2007


#614: SegFault/double free with simple array mask operation
-------------------------+--------------------------------------------------
 Reporter:  AchimGaedke  |       Owner:  somebody                      
     Type:  defect       |      Status:  new                           
 Priority:  high         |   Milestone:                                
Component:  numpy.core   |     Version:                                
 Severity:  major        |    Keywords:  SegmenationFault, MaskedArrays
-------------------------+--------------------------------------------------
 Please have a look at the program below:

 # start
 import numpy

 t_array=numpy.ones(2048, dtype=numpy.float32)
 sinc_array=numpy.array((len(t_array),),dtype=numpy.float32)
 sinc_array[(t_array > 0.)]=1.0
 # end

 If you execute this program, it crashes with Segmentation Fault or
 *** glibc detected *** python: double free or corruption (out):
 0x081fe470 ***

 It depends on the circumstances, which error occurs, e.g. you must quit
 your interpreter if you are in interactvie mode.

 Obviously numpy.array() should be numpy.zeros() or numpy.empty() ....
 But this program should not crash with a core dump.

 Used Linux Versions are:
 Debian Testing with numpy 1.0.3,
 Debian Stable with numpy 1.0.1,
 Ubuntu Linux 6.10 with numpy 1.0
 Also numpy-1.0.4 crashes.
 (The trac system does not know these versions?!)

-- 
Ticket URL: <http://scipy.org/scipy/numpy/ticket/614>
NumPy <http://projects.scipy.org/scipy/numpy>
The fundamental package needed for scientific computing with Python.


More information about the Numpy-tickets mailing list