[Numpy-discussion] dot and deallocation bug?

Zachary Pincus zpincus at stanford.edu
Mon Mar 13 17:28:07 CST 2006


Hi folks,

I've run across an odd error in my numpy install related to numpy.dot  
with python lists of floats.

Now, I haven't updated from svn in a while (I'm currently using numpy  
to do some data analysis, so I'm not changing things until that's  
done). Perhaps someone could confirm whether this is still a bug in  
the current version?

Here's how I reproduce the error (OS X 10.4.5), python 2.4.2:

In [1]: import numpy
In [2]: numpy.version.version
Out[2]: '0.9.6.2208'
In [3]: numpy.dot([0.0, 1.0], [1, 2, 3])
ValueError: matrices are not aligned

In [4]: numpy.dot([0.0, 1.0], [1, 2, 3])
ValueError: matrices are not aligned

In [5]: numpy.dot([0.0, 1.0], [1, 2, 3])
Python(5957) malloc: ***  Deallocation of a pointer not malloced:  
0x1188bec; This could be a double free(), or free() called with the  
middle of an allocated block; Try setting environment variable  
MallocHelp to see tools to help debug

ValueError: matrices are not aligned

In [6]: numpy.dot([0.0, 1.0], [1, 2, 3])
Python(5957) malloc: ***  Deallocation of a pointer not malloced:  
0x1188bec; This could be a double free(), or free() called with the  
middle of an allocated block; Try setting environment variable  
MallocHelp to see tools to help debug
Python(5957) malloc: ***  Deallocation of a pointer not malloced:  
0x1188bec; This could be a double free(), or free() called with the  
middle of an allocated block; Try setting environment variable  
MallocHelp to see tools to help debug
Python(5957) malloc: ***  Deallocation of a pointer not malloced:  
0x1188bec; This could be a double free(), or free() called with the  
middle of an allocated block; Try setting environment variable  
MallocHelp to see tools to help debug

ValueError: matrices are not aligned

Always the third time after I do this incorrect dot operation, the  
malloc errors start appearing. The more times I do the operation, the  
longer the list of malloc errors gets. If the input lists are not  
floating-point, this doesn't happen (also the ValueError states:  
'objects are not aligned' instead of 'matrices are not aligned').

Any thoughts?

Zach Pincus





More information about the Numpy-discussion mailing list