segfault with min() method on fortran-strided arrays.
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
Already fixed in svn -- thanks Travis. Zach On Mar 28, 2006, at 6:43 PM, Zachary Pincus wrote:
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
------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel? cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ Numpy-discussion mailing list Numpy-discussion@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/numpy-discussion
participants (1)
-
Zachary Pincus