[cctbxbb] Strange segementation fault
Luc Bourhis
luc_j_bourhis at mac.com
Wed Jul 22 16:52:10 PDT 2009
Hi Armin,
> When I import from the cctbx and perform a division through zero (with
> array objects from numpy) something segfaults.
During the first import of any cctbx module, some code is run to
switch on the trapping of floating point exceptions. Thus after that
import, divsion-by-zero, NaN-production and overflows result in a
stacktrace indeed, which is usually not the default.
You should see a message telling you about one way to suppress that
behaviour (after the stacktrace). You can indeed set any of the
following environment variable: BOOST_ADAPTBX_FE_OVERFLOW_DEFAULT,
BOOST_ADAPTBX_FE_INVALID_DEFAULT, BOOST_ADAPTBX_FE_DIVBYZERO_DEFAULT,
BOOST_ADAPTBX_FPE_DEFAULT. They respectively revert to the default
behaviour of your platform for respectively overflows, NaN, division
by zero and all of those three.
There is a programmatic way to suppress trapping too.
from boost.python import floating_point_exceptions
# Then any combination of the following
floating_point_exceptions.division_by_zero_trapped = False
floating_point_exceptions.invalid_trapped = False
floating_point_exceptions.overflow_trapped = False
> I did not observe this behaviour on windows
We have not installed those traps on Windows indeed. Only on Linux and
MacOS X.
Luc Bourhis
Computer Scientist
Chemical Crystallography Laboratory
University of Durham, UK
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2425 bytes
Desc: not available
Url : http://www.phenix-online.org/pipermail/cctbxbb/attachments/20090723/3eb73ffa/smime.bin
More information about the cctbxbb
mailing list