[Numpy-discussion] segfault with min() method on fortran-strided arrays.

Zachary Pincus zpincus at stanford.edu
Tue Mar 28 18:44:03 EST 2006


Hi,

I found a segfault in numpy that seems to have to do with the new  
'order' stuff. Steps to reproduce and gdb backtrace below. This is  
new since numpy 0.9.7.2262, which is what I updated from today.

Zach


In [1]: import numpy
In [2]: a = numpy.array([[1,2],[3,4],[5,6]])
In [3]: b = numpy.transpose(a)
In [4]: a.min()
Out[4]: 1
In [5]: b.min()

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x0000000c
_check_axis (arr=0x76696577, axis=0xbfffeb0c, flags=0) at numpy/core/ 
src/arrayobject.c:3505
3505                    *axis = PyArray_NDIM(temp)-1;
(gdb) backtrace
#0  _check_axis (arr=0x76696577, axis=0xbfffeb0c, flags=0) at numpy/ 
core/src/arrayobject.c:3505
#1  0x01170594 in array_min (self=0x6776b0, args=0x139eba0, kwds=0x0)  
at numpy/core/src/multiarraymodule.c:2909
#2  0x0028b984 in PyEval_EvalFrame (f=0x1868c10) at Python/ceval.c:3558
[...python stack frames snipped...]
(gdb) info locals
newdim = {
   ptr = 0xbfffeaa8,
   len = 1
}
val = {-1}
temp = (PyObject *) 0x6776b0
n = 2
(gdb) info args
arr = (PyArrayObject *) 0x76696577
axis = (int *) 0xbfffeb0c
flags = 0





More information about the NumPy-Discussion mailing list