[Scipy-tickets] [SciPy] #1313: My fight with arpack

SciPy Trac scipy-tickets@scipy....
Mon Oct 18 17:08:43 CDT 2010

#1313: My fight with arpack
 Reporter:  nics    |       Owner:  somebody
     Type:  defect  |      Status:  new     
 Priority:  normal  |   Milestone:  0.9.0   
Component:  Other   |     Version:  0.8.0   
 Keywords:          |  
 Hello everybody,

 finally I managed to get through the arpack-testsuite on

 Ther're three issues here; I think there are some dups of them and thus,
 the results might be useful for others.
 The issues are:
 I) Corruption of my holy heap resulting in SIGSEGV/SIGBUS in libc
 II) The starting vector of eigen, eigen_symmetric will be overwritten by
 arpack making multiple calls with the same starting vector impossible and
 this is not very clear to the user.
 III) The testsuite's result comparison fail because the results depend
 strongly on the starting vector which is random per default.

 I. My backtrace is:
 #0  0xfee570a8 in t_splay () from /lib/libc.so.1
 #1  0xfee56f38 in t_delete () from /lib/libc.so.1
 #2  0xfee56b4c in realfree () from /lib/libc.so.1
 #3  0xfee57348 in _free_unlocked () from /lib/libc.so.1
 #4  0xfee57284 in free () from /lib/libc.so.1
 #5  0xfed4c1a4 in array_dealloc (self=0x94dd18)
     at numpy/core/src/multiarray/arrayobject.c:212
 #6  0xff1f0a9c in frame_dealloc (f=0x9c6880) at Objects/frameobject.c:458
 #7  0xff2b5660 in tb_dealloc (tb=0x98d698) at Python/traceback.c:28

 Utilizing electric fence:
 #0  0xff3a0810 in memcpy ()
    from /platform/SUNW,SPARC-Enterprise/lib/libc_psr.so.1
 #1  0xfca61a5c in ATL_scopy (N=4, X=0xef889efc, incX=<value optimized
     Y=0xef96dff4, incY=<value optimized out>) at ATL_scopy.c:50
 #2  0xfe7b6cbc in atl_f77wrap_scopy_ (N=0xffbfa4cc, X=0xef889efc,
     INCX=0xf7efa6b0, Y=0xef96dff4, INCY=0xf7efa6b0)
 #3  0xfe7b687c in scopy (n=4, x=..., incx=1, y=..., incy=1)
 #4  0xf7ea5200 in sneupd_ ()

 With this information, google has been my friend: Finally I reached here:
 The proposed diff fixes the problem. See the attached
 02_debian_bug572935.diff for an adjustement to the scipy-0.8.0 source
 tree. I've seen others here encountering strange segfaults in libc, too.

 I've found this point while fixing III. See 03_arpack_copy_v0.diff for a

 This had been the hardest issue to find the reason for since I've never
 done anything with ARPACK.
 What I've got was an InvalidIndexError here:
 arpack.py:264 z[:,i] = zr[:,i] + 1.0j * zr[:,i+1]
 called (indirectly) from test_nonsymmetric_modes.
 The reason is the following: I've got three eigenvalues in d with
 imaginary part nonzero.
 Why do I get it and you don't:
 If you don't give arpack a starting vector, it'll generate a random one
 (THIS SHOULD BE DOCUMENTED!) and this influences
 - which eigenvalues are returned by ARPACK
 - in which order they're returned.
 I've written two pure fortran test programs resembling python's ARPACK
 usage if you want to verify this (also happens on my Ubuntu Lucid Lynx
 x86_64 box).
 One should think about fixing that piece of code there in arpack.py
 (taking into account the possibility of an odd number of imaginary
 eigenvalues). But the testsuite will still fail due to the fact that the
 set of eigenvalues returned is not fixed. The solution is to fix them by
 giving starting vectors in the testsuite (see



Ticket URL: <http://projects.scipy.org/scipy/ticket/1313>
SciPy <http://www.scipy.org>
SciPy is open-source software for mathematics, science, and engineering.

More information about the Scipy-tickets mailing list