[Numpy-tickets] [NumPy] #551: numpy.ndarray messed up after unpickling

NumPy numpy-tickets@scipy....
Thu Apr 10 16:20:09 CDT 2008

#551: numpy.ndarray messed up after unpickling
 Reporter:  cotackst                   |        Owner:  somebody
     Type:  defect                     |       Status:  new     
 Priority:  normal                     |    Milestone:  1.0.5   
Component:  numpy.core                 |      Version:  1.0.1   
 Severity:  critical                   |   Resolution:          
 Keywords:  pickle, ndarray, segfault  |  
Comment (by pv):

 I think a reference to the unpickled string is kept in self->base, and to
 my understanding it is INCREF'd properly on arraymethods.c:1303. But I'm
 not familiar with this code, so a more informed opinion would be helpful.
 But note that replacing in the code above
 print "y:", y.__array_interface__['data'][0] % y.dtype.itemsize,
 sys.getrefcount(y.base), type(y.base)
 I get
 y: 4 2 <type 'str'>
 So the base of y is a string with refcount 2, which is ok (but it's not
 aligned at double-boundary). Also, if it was a reference count problem, it
 would be difficult to understand why a segfault occurs only for the
 SSE2-optimized Atlas library (and not for reference blas, or Atlas with
 other optimizations).

Ticket URL: <http://scipy.org/scipy/numpy/ticket/551#comment:20>
NumPy <http://projects.scipy.org/scipy/numpy>
The fundamental package needed for scientific computing with Python.

More information about the Numpy-tickets mailing list