[SciPy-user] Segfault on ndimage.test() - the long odyssey that is 64 bit

Matthew Brett matthew.brett at gmail.com
Sat Mar 25 09:03:44 CST 2006


Hi,

Sorry to keep bombarding the list with 64-bit troubles.

In brief - scipy.ndimage.test() segfaults on my x86-64 P4 system, but
passes on other x86-32 systems.

After many interations of gcc versions and compile flags, I
successfully compiled scipy / ATLAS on my 64bit FC4 P4 system - in the
end using gcc / g77 3.4.6.

When running scipy.test(), I get a segfault.  This turns out to be
from scipy.ndimage.test().  I've appended a backtrace from gdb in the
hope that it's useful.

I have an older Redhat P4 x86-32 ES3 system for which all tests pass -
so this issue seems to be specific to 64 bit.

It may also be specific to the 64 bit compile of python - on an almost
identical ubuntu 64 bit platform, but with a 32-bit python (as
standard) - I get a different set of errors (also attached as
ndimag_test_out.txt) - I assume this is expected?

Has anyone had the same trouble?  Is there anyone out there running a
P4 / Python 64 bit / latest SVN numpy,scipy / x86-64 bit linux system
that isn't getting this behavior?  I've attached my ATLAS and LAPACK
make includes for reference,

Best,

Matthew


gdb output:

>>> import scipy.ndimage
>>> scipy.ndimage.test()
  Found 397 tests for scipy.ndimage
  Found 0 tests for __main__
............................................................................................................................................E....E.E..................................................................................
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 46912496295936 (LWP 17678)]
0x00002aaaafbfb3f5 in NI_Histogram (input=0x821310, labels=0x0, min_label=-1,
    max_label=0, indices=0x0, n_results=1, histograms=0x822c00, min=0, max=10,
    nbins=210453397514) at Lib/ndimage/src/ni_measure.c:752
752     Lib/ndimage/src/ni_measure.c: No such file or directory.
        in Lib/ndimage/src/ni_measure.c
(gdb) bt
#0  0x00002aaaafbfb3f5 in NI_Histogram (input=0x821310, labels=0x0,
    min_label=-1, max_label=0, indices=0x0, n_results=1, histograms=0x822c00,
    min=0, max=10, nbins=210453397514) at Lib/ndimage/src/ni_measure.c:752
#1  0x00002aaaafbf0ee4 in Py_Histogram (obj=Variable "obj" is not available.
)
    at Lib/ndimage/src/nd_image.c:1103
#2  0x00000031b8b8da11 in PyEval_EvalFrame ()
   from /usr/lib64/libpython2.4.so.1.0
#3  0x00000031b8b8e238 in PyEval_EvalCodeEx ()
   from /usr/lib64/libpython2.4.so.1.0
#4  0x00000031b8b8d6a1 in PyEval_EvalFrame ()
   from /usr/lib64/libpython2.4.so.1.0
#5  0x00000031b8b8d775 in PyEval_EvalFrame ()
   from /usr/lib64/libpython2.4.so.1.0
#6  0x00000031b8b8e238 in PyEval_EvalCodeEx ()
   from /usr/lib64/libpython2.4.so.1.0
#7  0x00000031b8b49922 in PyFunction_SetClosure ()
   from /usr/lib64/libpython2.4.so.1.0
#8  0x00000031b8b3783b in PyObject_Call () from /usr/lib64/libpython2.4.so.1.0
#9  0x00000031b8b8c164 in PyEval_EvalFrame ()
   from /usr/lib64/libpython2.4.so.1.0
#10 0x00000031b8b8e238 in PyEval_EvalCodeEx ()
   from /usr/lib64/libpython2.4.so.1.0
#11 0x00000031b8b49922 in PyFunction_SetClosure ()
---Type <return> to continue, or q <return> to quit---
   from /usr/lib64/libpython2.4.so.1.0
#12 0x00000031b8b3783b in PyObject_Call () from /usr/lib64/libpython2.4.so.1.0
#13 0x00000031b8b3e455 in PyMethod_Fini () from /usr/lib64/libpython2.4.so.1.0
#14 0x00000031b8b3783b in PyObject_Call () from /usr/lib64/libpython2.4.so.1.0
#15 0x00000031b8b8a4a0 in PyEval_EvalFrame ()
   from /usr/lib64/libpython2.4.so.1.0
#16 0x00000031b8b8e238 in PyEval_EvalCodeEx ()
   from /usr/lib64/libpython2.4.so.1.0
#17 0x00000031b8b49922 in PyFunction_SetClosure ()
   from /usr/lib64/libpython2.4.so.1.0
#18 0x00000031b8b3783b in PyObject_Call () from /usr/lib64/libpython2.4.so.1.0
#19 0x00000031b8b3e455 in PyMethod_Fini () from /usr/lib64/libpython2.4.so.1.0
#20 0x00000031b8b3783b in PyObject_Call () from /usr/lib64/libpython2.4.so.1.0
#21 0x00000031b8b6dd15 in _PyObject_SlotCompare ()
   from /usr/lib64/libpython2.4.so.1.0
#22 0x00000031b8b3783b in PyObject_Call () from /usr/lib64/libpython2.4.so.1.0
#23 0x00000031b8b8a4a0 in PyEval_EvalFrame ()
   from /usr/lib64/libpython2.4.so.1.0
#24 0x00000031b8b8e238 in PyEval_EvalCodeEx ()
   from /usr/lib64/libpython2.4.so.1.0
#25 0x00000031b8b49922 in PyFunction_SetClosure ()
   from /usr/lib64/libpython2.4.so.1.0
#26 0x00000031b8b3783b in PyObject_Call () from /usr/lib64/libpython2.4.so.1.0
---Type <return> to continue, or q <return> to quit---
#27 0x00000031b8b8c164 in PyEval_EvalFrame ()
   from /usr/lib64/libpython2.4.so.1.0
#28 0x00000031b8b8e238 in PyEval_EvalCodeEx ()
   from /usr/lib64/libpython2.4.so.1.0
#29 0x00000031b8b49922 in PyFunction_SetClosure ()
   from /usr/lib64/libpython2.4.so.1.0
#30 0x00000031b8b3783b in PyObject_Call () from /usr/lib64/libpython2.4.so.1.0
#31 0x00000031b8b3e455 in PyMethod_Fini () from /usr/lib64/libpython2.4.so.1.0
#32 0x00000031b8b3783b in PyObject_Call () from /usr/lib64/libpython2.4.so.1.0
#33 0x00000031b8b6dd15 in _PyObject_SlotCompare ()
   from /usr/lib64/libpython2.4.so.1.0
#34 0x00000031b8b3783b in PyObject_Call () from /usr/lib64/libpython2.4.so.1.0
#35 0x00000031b8b8a4a0 in PyEval_EvalFrame ()
   from /usr/lib64/libpython2.4.so.1.0
#36 0x00000031b8b8d775 in PyEval_EvalFrame ()
   from /usr/lib64/libpython2.4.so.1.0
#37 0x00000031b8b8e238 in PyEval_EvalCodeEx ()
   from /usr/lib64/libpython2.4.so.1.0
#38 0x00000031b8b8d6a1 in PyEval_EvalFrame ()
   from /usr/lib64/libpython2.4.so.1.0
#39 0x00000031b8b8e238 in PyEval_EvalCodeEx ()
   from /usr/lib64/libpython2.4.so.1.0
#40 0x00000031b8b8e471 in PyEval_EvalCode ()
---Type <return> to continue, or q <return> to quit---
   from /usr/lib64/libpython2.4.so.1.0
#41 0x00000031b8ba8801 in PyErr_Display () from /usr/lib64/libpython2.4.so.1.0
#42 0x00000031b8ba9a07 in PyRun_InteractiveOneFlags ()
   from /usr/lib64/libpython2.4.so.1.0
#43 0x00000031b8ba9ae4 in PyRun_InteractiveLoopFlags ()
   from /usr/lib64/libpython2.4.so.1.0
#44 0x00000031b8ba9fdf in PyRun_AnyFileExFlags ()
   from /usr/lib64/libpython2.4.so.1.0
#45 0x00000031b8baf313 in Py_Main () from /usr/lib64/libpython2.4.so.1.0
#46 0x00000031b3e1c3cf in __libc_start_main () from /lib64/libc.so.6
#47 0x0000000000400689 in _start ()
#48 0x00007ffffff6c718 in ?? ()
#49 0x0000000000000000 in ?? ()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: make.inc
Type: application/octet-stream
Size: 1420 bytes
Desc: not available
Url : http://www.scipy.net/pipermail/scipy-user/attachments/20060325/28d2d95f/make.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Make.Linux_gcc34
Type: application/octet-stream
Size: 6220 bytes
Desc: not available
Url : http://www.scipy.net/pipermail/scipy-user/attachments/20060325/28d2d95f/Make.obj
-------------- next part --------------
  Found 397 tests for scipy.ndimage
  Found 0 tests for __main__
............................................................................................................................................E....E.E.........................................................................................................................................................................................................................................................
======================================================================
ERROR: brute force distance transform 4
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/matthew/lib/python2.4/site-packages/scipy/ndimage/tests/test_ndimage.py", line 3443, in test_distance_transform_bf04
    return_distances = False, return_indices = True, indices = ft)
  File "/home/matthew/lib/python2.4/site-packages/scipy/ndimage/morphology.py", line 578, in distance_transform_bf
    raise RuntimeError, 'indices must of Int32 type'
RuntimeError: indices must of Int32 type

======================================================================
ERROR: chamfer type distance transform 3
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/matthew/lib/python2.4/site-packages/scipy/ndimage/tests/test_ndimage.py", line 3653, in test_distance_transform_cdt03
    return_distances = False, return_indices = True, indices = ft)
  File "/home/matthew/lib/python2.4/site-packages/scipy/ndimage/morphology.py", line 677, in distance_transform_cdt
    raise RuntimeError, 'indices must of Int32 type'
RuntimeError: indices must of Int32 type

======================================================================
ERROR: euclidean distance transform 2
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/matthew/lib/python2.4/site-packages/scipy/ndimage/tests/test_ndimage.py", line 3729, in test_distance_transform_edt02
    return_distances = False,return_indices = True, indices = ft)
  File "/home/matthew/lib/python2.4/site-packages/scipy/ndimage/morphology.py", line 742, in distance_transform_edt
    raise RuntimeError, 'indices must be of Int32 type'
RuntimeError: indices must be of Int32 type

----------------------------------------------------------------------
Ran 397 tests in 0.798s

FAILED (errors=3)


More information about the SciPy-user mailing list