[Scipy-tickets] [SciPy] #868: segfault on incorrect index type in ndimage.measurements

SciPy scipy-tickets@scipy....
Wed Feb 11 18:46:44 CST 2009


#868: segfault on incorrect index type in ndimage.measurements
---------------------------+------------------------------------------------
 Reporter:  josefpktd      |       Owner:  somebody
     Type:  defect         |      Status:  new     
 Priority:  normal         |   Milestone:  0.8.0   
Component:  scipy.ndimage  |     Version:  devel   
 Severity:  normal         |    Keywords:          
---------------------------+------------------------------------------------
 this causes a crash:

 {{{
 python25 -i -c "import numpy as np; from scipy import ndimage; print
 ndimage.mean(np.arange(5), labels=np.arange(5),
 index=np.arange(5).astype('string'))"
 }}}

 same for ndimage.variance, and I guess others

 string type in `labels` raises exception, `index` needs a similar type
 check
 {{{
 python25 -i -c "import numpy as np; from scipy import ndimage; print
 ndimage.mea
 n(np.arange(5), labels=np.arange(5).astype('string'), index=np.arange(5))"
 Traceback (most recent call last):
   File "<string>", line 1, in <module>
   File "\Programs\Python25\Lib\site-
 packages\scipy\ndimage\measurements.py", lin
 e 145, in mean
     return _nd_image.statistics(input, labels, index, 1)
 RuntimeError: data type not supported
 }}}

-- 
Ticket URL: <http://scipy.org/scipy/scipy/ticket/868>
SciPy <http://www.scipy.org/>
SciPy is open-source software for mathematics, science, and engineering.


More information about the Scipy-tickets mailing list