[Numpy-discussion] numpy / ipython heisenbug crasher help?

Zachary Pincus zachary.pincus@yale....
Thu Aug 7 14:22:26 CDT 2008


Hello all,

I have a bizarre bug that causes numpy to segfault, but:
  - only when run under ipython
  - only when numpy is imported *after* an other library (that does  
not import numpy)

Here's what the code looks like.
Crashes (only in ipython):
import celltool.utility.pil_lite.Image as Image, numpy
i = Image.open('untreated_2_logical.png')
a = numpy.array(i)

Does not crash:
import numpy, celltool.utility.pil_lite.Image as Image
i = Image.open('untreated_2_logical.png')
a = numpy.array(i)

The 'i' object exposes an __array_interface__, and is produced from my  
personal fork of the PIL.

The crash is thusly reported:
Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x000000000251f000

0   libSystem.B.dylib 0xffff0a13 __memcpy + 627
1   multiarray.so     0x022f7af8 _array_copy_into + 2840  
(arrayobject.c:1113)
2   multiarray.so     0x022f88af PyArray_FromArray + 495  
(arrayobject.c:8334)
3   multiarray.so     0x022ee314 PyArray_FromAny + 308 (arrayobject.c: 
8814)
4   multiarray.so     0x022fb01c PyArray_CheckFromAny + 92  
(arrayobject.c:8995)
5   multiarray.so     0x022fb2e6 _array_fromobject + 310  
(multiarraymodule.c:5787)
[And then the python stack frames]

Can anyone suggest what a good next step in reducing this patently  
insane bug down to a more minimal test case is? I had this bug with  
numpy 1.1 as well as the current SVN head.

Zach


More information about the Numpy-discussion mailing list