[SciPy-user] eig() segfaults on SuSE 9.3 with ACML, Numeric's eigenvectors works

Arnd Baecker arnd.baecker at web.de
Mon Nov 14 02:48:27 EST 2005



On Sun, 13 Nov 2005, Robert Dick wrote:

> SuSE 9.3 comes with libblas and liblapack.  However, they don't define srotmg.
> Therefore, SciPy doesn't work with them.
>
> AMD provides an optimized BLAS/LAPACK library called ACML.  After installing
> that and directing SciPy to it with site.cfg, SciPy builds.  Unfortunately,
> linalg.eig(), produces results that do not conform to the documentation (the
> matrix holding the eigenvectors is transposed).  I transpose this matrix in
> my own code but find that eig() also intermittantly segfaults for matrices of
> significant size.  My machine is otherwise quite stable: this is probably not
> caused by a hardware problem.
>
> Has anybody been able to get SciPy working reliably on an Athlon SuSE 9.3
> machine?
>
> Does the following code work without segfaulting for anybody else?  It runs
> fine as long as I use Numeric but segfaults if I use SciPy.  By the way, I'm
> linking against AMD's ACML BLAS/LAPACK library from both Numeric and SciPy.
> ----
> import Numeric as n1
> import LinearAlgebra as la1
> import scipy as n2
> import scipy.linalg as la2
>
> while 1:
> 	mat2 = n2.stats.rand(5, 5)
> 	mat1 = n1.array(mat2)
> 	print la1.eigenvectors(mat1)
> #	print la2.eig(mat2)
> ----


I also get a segfault for

  import scipy as n2
  import scipy.linalg as la2
  mat2 = n2.stats.rand(5, 5)
  print la2.eig(mat2)

This is on SUSE 10.0, 64Bit Opteron,
In [3]: scipy.__core_version__
Out[3]: '0.6.2.1482'
In [4]: scipy.__scipy_version__
Out[4]: '0.4.2_1442'
I am using ATLAS, so I don't think it is an ACML-ATLAS issue.


Some more details:
gdb
(gdb) file /scr/python/bin/python
(gdb) run
Starting program: /scr/python/bin/python
[Thread debugging using libthread_db enabled]
[New Thread 46912507335168 (LWP 31397)]
Python 2.4.2 (#1, Oct  4 2005, 10:10:47)
[GCC 3.4.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import scipy as n2
[...]
>>> import scipy.linalg as la2
>>> mat2 = n2.stats.rand(5, 5)
>>> print la2.eig(mat2)

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 46912507335168 (LWP 31397)]
0x00002aaaab3a2cdb in memmove () from /lib64/tls/libc.so.6
(gdb) bt
#0  0x00002aaaab3a2cdb in memmove () from /lib64/tls/libc.so.6
#1  0x00002aaaab96246c in PyArray_CopyInto (dest=0x2aaab55609e0, src=0x8)
at arrayobject.c:658
#2  0x00002aaaab96735b in array_imag_set (self=0x2aaab55608f0,
val=0x83000d690097dd63) at arrayobject.c:4260
#3  0x00000000004c21ea in getset_set (descr=0x2aaaaab37ea8,
obj=0x2aaab55608f0, value=0x2aaab5560990) at descrobject.c:200
#4  0x000000000043cc05 in PyObject_GenericSetAttr (obj=0x2aaab55608f0,
name=0x2aaaaab08ba0, value=0x2aaab5560990) at object.c:1378
#5  0x000000000043c690 in PyObject_SetAttr (v=0x2aaab55608f0,
name=0x2aaaaab08ba0, value=0x2aaab5560990) at object.c:1128
#6  0x0000000000475f53 in PyEval_EvalFrame (f=0x8a7b10) at ceval.c:1761
#7  0x0000000000479fb1 in PyEval_EvalFrame (f=0x742340) at ceval.c:3640
#8  0x000000000047ad2f in PyEval_EvalCodeEx (co=0x2aaab2610b20,
globals=0x8c71b1, locals=0x83000d690097dd6b, args=0x742340, argcount=1,
kws=0x747678, kwcount=0,
    defs=0x2aaab260fb48, defcount=5, closure=0x0) at ceval.c:2736
#9  0x00000000004788f7 in PyEval_EvalFrame (f=0x7474e0) at ceval.c:3650
#10 0x000000000047ad2f in PyEval_EvalCodeEx (co=0x2aaab24dcb90,
globals=0x8c71b1, locals=0x83000d690097dd6b, args=0x7474e0, argcount=0,
kws=0x0, kwcount=0,
    defs=0x0, defcount=0, closure=0x0) at ceval.c:2736
#11 0x000000000047af72 in PyEval_EvalCode (co=0x83000d690097dd63,
globals=0x8c71b1, locals=0x83000d690097dd6b) at ceval.c:484
#12 0x00000000004a1c72 in PyRun_InteractiveOneFlags (fp=0x2aaaaab13a30,
filename=0x4cbf24 "<stdin>", flags=0x7fffffd28f2c) at pythonrun.c:1265
#13 0x00000000004a1e04 in PyRun_InteractiveLoopFlags (fp=0x2aaaab556b00,
filename=0x4cbf24 "<stdin>", flags=0x7fffffd28f2c) at pythonrun.c:695
#14 0x00000000004a2350 in PyRun_AnyFileExFlags (fp=0x2aaaab556b00,
filename=0x8c71b1 "\f~.\\$\034\a?^\206W6X\237?", closeit=0,
flags=0x7fffffd28f2c)
    at pythonrun.c:658
#15 0x0000000000410788 in Py_Main (argc=0, argv=0x7fffffd2a9ce) at
main.c:484
#16 0x00002aaaab34d5aa in __libc_start_main () from /lib64/tls/libc.so.6
#17 0x000000000040fdfa in _start () at start.S:113
#18 0x00007fffffd29028 in ?? ()
#19 0x00002aaaaabc19c0 in rtld_errno () from /lib64/ld-linux-x86-64.so.2

Travis, does this already help you enough to see where
the problem comes from, or do you need further input?

Concerning the transpose:
If I am not mistaken, already "old" scipy leads to
a transposed matrix.

Best, Arnd




More information about the SciPy-User mailing list