[Numpy-tickets] [NumPy] #551: numpy.ndarray messed up after unpickling
NumPy
numpy-tickets@scipy....
Mon Jul 16 17:01:11 CDT 2007
#551: numpy.ndarray messed up after unpickling
------------------------+---------------------------------------------------
Reporter: cotackst | Owner: somebody
Type: defect | Status: new
Priority: normal | Milestone:
Component: numpy.core | Version: 1.0.1
Severity: normal | Keywords: pickle, ndarray, segfault
------------------------+---------------------------------------------------
After unpickling a pickled numpy.ndarray matrix (using cPickle), I get a
segmentation fault when trying to multiply the matrix by a vector. However
I can multiply a copy of the matrix with the same vector.
The code to generate the actual matrix is quite large, so I only attach
the pickled matrix ('mat.bug').
Reproducing code:[[BR]]
from cPickle import Unpickler[[BR]]
from numpy import ones, dot[[BR]]
bug_mat = Unpickler(file('mat.bug','r')).load()[[BR]]
ok_mat = bug_mat.copy()[[BR]]
v = ones((1,bug_mat.shape[0]))[[BR]]
dot(v,ok_mat) # this works[[BR]]
dot(v,bug_mat) # this segfault[[BR]]
--
Ticket URL: <http://projects.scipy.org/scipy/numpy/ticket/551>
NumPy <http://projects.scipy.org/scipy/numpy>
The fundamental package needed for scientific computing with Python.
More information about the Numpy-tickets
mailing list