[NumPy-Tickets] [NumPy] #1737: numpy.test() seg faults

NumPy Trac numpy-tickets@scipy....
Wed Feb 9 14:57:01 CST 2011


#1737: numpy.test() seg faults
------------------------+---------------------------------------------------
 Reporter:  sienkiew    |       Owner:  somebody
     Type:  defect      |      Status:  new     
 Priority:  high        |   Milestone:  2.0.0   
Component:  numpy.core  |     Version:  devel   
 Keywords:              |  
------------------------+---------------------------------------------------

Comment(by m-paradox):

 Good detective work! In this case, I believe it doesn't call
 CanCastTypeTo, it calls CanCastArrayTo because the product is
 array*scalar, so the value-based type demotion is permitted to kick in.
 CanCastArrayTo is a bit more complicated, I can definitely imagine
 something tripping up in there. One possibility is that the gcc
 preprocessor is getting the '#if NPY_SIZEOF_LONGLONG >=
 NPY_SIZEOF_CLONGDOUBLE' wrong, and making a npy_longlong instead of
 npy_clongdouble. This would definitely cause some scribbling on the stack.

 What you can try is, in core/src/multiarray/convert_datatype.c, replace
 this

 {{{
 #if NPY_SIZEOF_LONGLONG >= NPY_SIZEOF_CLONGDOUBLE
         npy_longlong value;
 #else
         npy_clongdouble value;
 #endif
 }}}

 with this

 {{{
         npy_longlong value[4];
 }}}

-- 
Ticket URL: <http://projects.scipy.org/numpy/ticket/1737#comment:7>
NumPy <http://projects.scipy.org/numpy>
My example project


More information about the NumPy-Tickets mailing list