[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 Codes: KERN_INVALID_ADDRESS at 0x000000000251f000

0   libSystem.B.dylib 0xffff0a13 __memcpy + 627
1   multiarray.so     0x022f7af8 _array_copy_into + 2840  
2   multiarray.so     0x022f88af PyArray_FromArray + 495  
3   multiarray.so     0x022ee314 PyArray_FromAny + 308 (arrayobject.c: 
4   multiarray.so     0x022fb01c PyArray_CheckFromAny + 92  
5   multiarray.so     0x022fb2e6 _array_fromobject + 310  
[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.


More information about the Numpy-discussion mailing list