[cctbxbb] Strange segementation fault

Armin Moser armin.moser at student.tugraz.at
Wed Jul 22 09:46:48 PDT 2009


Dear cctbx-developers,

I recently started to use the cctbx. Some days before i may have found a
bug.

Description:
When I import from the cctbx and perform a division through zero (with
array objects from numpy) something segfaults. I've appended a script
that demonstrates this behaviour.
Maybe it's just a problem with my specific system (I did not observe
this behaviour on windows).

I've compiled the cctbx from the unix sources with the build tag
2008_09_13_0905 on a debian testing system:
Python 2.5.4,
gcc 4.3.3,
libboost.python1.37.0
Do you need information on other libraries too?

Can anybody reproduce this or has an idea what could be wrong? Maybe
someone can give me a hint how I could try to debug this?

Thanks
Armin

-----------------8<--------------------8<------------
import numpy as np

a = np.array([[1,2,3],[4,5,6]])
b = np.zeros(a.shape)
b[[0,0,1],[1,2,0]] = 1
c = a/b
print 'before import x/0 is not a problem'
print c

import cctbx
from cctbx import xray, crystal, miller,  sgtbx, uctbx
from cctbx_array_family_flex_ext import miller_index
import scitbx_array_family_flex_ext
from iotbx.shelx import from_ins

lo    = b!= 0
c = np.ones(a.shape)*np.inf
c_div = a[lo]/b[lo]
c[lo] = c_div
print 'after import workaround'
print c

print 'after import x/0 ==> segfault'
print a/b



More information about the cctbxbb mailing list