[SciPy-User] segfault using _sparse_ svd, eigen, eigen_symmetric with svn 0.9.0.dev6598

Jose Quesada quesada@gmail....
Wed Jul 21 10:59:45 CDT 2010


We are on a coding sprint trying to implement sparse matrix support in MDP (
The new sparse.linalg is very useful here.

We are getting segfaults using _sparse_ svd, eigen, eigen_symmetric with svn
0.9.0.dev6598. I understand that (1) this is an unreleased version, and (2)
these methods may depend on external C and fortran code that could have not
being installed well on my machine, so this may be difficult to debug. I
have added instructions to reproduce the segfault, but please ask for
anything else that could be needed and I'll try to provide it.

I installed the svn version on a virtualenv using pip:~/.virtualenvs/sprint$
pip install svn+http://svn.scipy.org/svn/scipy/trunk/#egg=scipyc

This generates a long log that could contain the explanation, so I posted it
here (going as far back as my terminal's scrollback enabled:

Last, here's an example that reproduces the segfault:

#!/usr/bin/env python
# -*- coding: utf-8 -*-

# simply run an svd on a a sparse matrix, svn 0.9.0.dev6598
import scipy
from scipy import sparse
from numpy.random import rand

# create random sparse matrix
x = scipy.sparse.lil_matrix((1000000, 1000000))
x[0, :100] = rand(100)
x[1, 100:200] = x[0, :100]
x = x.tocsr() # convert it to CSR
#v, u, w = scipy.sparse.linalg.eigen_symmetric(x) # segmentation fault

# try a simpler matrix
y = scipy.sparse.lil_matrix((10, 10))
y = y.tocsr() # convert it to CSR
#v, u, w = scipy.sparse.linalg.eigen_symmetric(y) #

#Traceback (most recent call last):
    #File "./sampleSegFault.py", line 13, in <module>
    #x[0, :100] = rand(100)
line 319, in __setitem__
    #x = lil_matrix(x, copy=False)
line 98, in __init__
    #A = csr_matrix(A, dtype=dtype).tolil()
line 71, in __init__
    #self._set_self( self.__class__(coo_matrix(arg1, dtype=dtype)) )
line 171, in __init__
    #self.data  = M[self.row,self.col]
    #ValueError: shape mismatch: objects cannot be broadcast to a single
    #*** glibc detected *** python: double free or corruption (!prev):
0x0000000004075ec0 ***

# some other linalg methods
ly,v = scipy.sparse.linalg.eig(y) # segmentation fault


Thanks a lot in advance,


Jose Quesada, PhD.
Max Planck Institute,
Center for Adaptive Behavior and Cognition,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-user/attachments/20100721/e9ac927a/attachment-0001.html 

More information about the SciPy-User mailing list