Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

segmentation fault with dot product of sparse matrices (Trac #1983) #2576

Closed
numpy-gitbot opened this issue Oct 19, 2012 · 3 comments
Closed

Comments

@numpy-gitbot
Copy link

Original ticket http://projects.scipy.org/numpy/ticket/1983 on 2011-11-18 by trac user fp4code, assigned to unknown.

The dot product of two sparse matrices crashes python.
The defect has appeared with

commit 867cabefe92b127b765580432b4c05d92342e275
Author: Mark Wiebe <mwiebe@enthought.com>
Date:   Fri Jul 22 10:24:14 2011 -0500

Here an example:

######################################
import sys, numpy, scipy, scipy.sparse
md = numpy.matrix(numpy.zeros((2,2))); md[0,1]=-1; md[1,0]=1
ms = scipy.sparse.lil_matrix(md)
print(sys.version)           # 2.7.2 [GCC 4.5.2]
print(numpy.version.version) # 2.0.0.dev-867cabe to 7297785
print(scipy.version.version) # 0.11.0.dev-badad3f or earlier
print(md*md)                 # OK
print(numpy.dot(md,md))      # OK
print(ms*ms)                 # OK
print(numpy.dot(ms,ms))      # Segmentation fault #
###################################################
@numpy-gitbot
Copy link
Author

@nilswagner01 wrote on 2011-11-19

[[-1. 0.]
[ 0. -1.]]
[[-1. 0.]
[ 0. -1.]](0, 0) -1.0
(1, 1) -1.0

Program received signal SIGSEGV, Segmentation fault.
PyArray_MatrixProduct2 (op1=0xce1390, op2=0xce1390, out=0x0)
at numpy/core/src/multiarray/multiarraymodule.c:955
955 Py_INCREF(typec);
(gdb) bt
#0 PyArray_MatrixProduct2 (op1=0xce1390, op2=0xce1390, out=0x0)
at numpy/core/src/multiarray/multiarraymodule.c:955
#1 0x00007ffff5f6dd79 in dotblas_matrixproduct (
__NPY_UNUSED_TAGGEDdummy=,
args=, kwargs=)
at numpy/core/blasdot/_dotblas.c:254
#2 0x00007ffff7b2166c in PyEval_EvalFrameEx ()
from /usr/lib64/libpython2.6.so.1.0
#3 0x00007ffff7b26441 in PyEval_EvalCodeEx ()
from /usr/lib64/libpython2.6.so.1.0
#4 0x00007ffff7b1fa32 in PyEval_EvalCode ()
from /usr/lib64/libpython2.6.so.1.0
#5 0x00007ffff7b3a7a1 in ?? () from /usr/lib64/libpython2.6.so.1.0
#6 0x00007ffff7b3aba4 in PyRun_FileExFlags ()
from /usr/lib64/libpython2.6.so.1.0
#7 0x00007ffff7b3b299 in PyRun_SimpleFileExFlags ()
from /usr/lib64/libpython2.6.so.1.0
#8 0x00007ffff7b42638 in Py_Main () from /usr/lib64/libpython2.6.so.1.0
#9 0x00007ffff6e8eb7d in __libc_start_main () from /lib64/libc.so.6
#10 0x00000000004006e9 in _start ()

@dlax
Copy link
Contributor

dlax commented Mar 29, 2013

I cannot reproduce the segfault with numpy 1.7, scipy 0.13.dev. This was fixed in eb46577.

@seberg
Copy link
Member

seberg commented Mar 31, 2013

Thanks for the note. Cannot reproduce current numpy as well (its a bit odd about what happens, but I guess that is just how it is and a different issue).

@seberg seberg closed this as completed Mar 31, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants