[Numpy-discussion] Floating exception

David Cournapeau david at silveregg.co.jp
Thu Jan 21 20:02:57 EST 2010


Nils Wagner wrote:

> # can't create 
> /data/home/nwagner/local/lib/python2.5/site-packages/numpy/core/info.pyc
> dlopen("/data/home/nwagner/local/lib/python2.5/site-packages/numpy/core/multiarray.so", 
> 2);
> 
> Program received signal SIGFPE, Arithmetic exception.
> [Switching to Thread 182894183648 (LWP 22301)]
> 0x000000350e8074d7 in do_lookup_x () from 
> /lib64/ld-linux-x86-64.so.2
> (gdb) bt
> #0  0x000000350e8074d7 in do_lookup_x () from 
> /lib64/ld-linux-x86-64.so.2
> #1  0x000000350e80789e in _dl_lookup_symbol_x () from 
> /lib64/ld-linux-x86-64.so.2
> #2  0x000000350e808c70 in _dl_relocate_object () from 
> /lib64/ld-linux-x86-64.so.2
> #3  0x000000350f7f7ac8 in dl_open_worker () from 
> /lib64/tls/libc.so.6
> #4  0x000000350e80aab0 in _dl_catch_error () from 
> /lib64/ld-linux-x86-64.so.2
> #5  0x000000350f7f845a in _dl_open () from 
> /lib64/tls/libc.so.6
> #6  0x000000350fc01054 in dlopen_doit () from 
> /lib64/libdl.so.2
> 
> Any idea ?

Are you using the python provided by your distribution ? The only 
reasonable reason I can think of is that some modules change the FPU 
exception handling without rolling it back before importing multiarray, 
and dlopen expects the FPU state to be in a certain state. It would be 
good to make sure you are only loading numpy (if you use 
easy_install/setuptools, it may cause other packages to import 
"automatically").

Or maybe multiarray causes a FPU exception in dlopen because multiarray 
is badly built or some other corner cases in do_lookup_x, although this 
sounds much less likely - one good way would be load numpy with the 
debug version of glibc to get the exact line failing inside 
do_lookup_x. I see only one integer division in the do_lookup_x code, 
but it would be good to confirm it actually happens there.

I don't know how it works on Centos to get your program loaded with the 
debug version of glibc,

cheers,

David



More information about the NumPy-Discussion mailing list