[Numpy-discussion] /usr/bin/python: double free or corruption
Travis E. Oliphant
oliphant@enthought....
Thu Apr 17 12:40:34 CDT 2008
Eric Emsellem wrote:
> Hi,
>
> I just installed a new openSuse 10.3, python, numpy, etc, on a 32 bit PC (using
> the rpm provide on the science Suse repository)
>
> When using numpy.fromfile, I get a glibc error when it tries to read something
> which is not there (end of the file).
> So for example with a file "tmp" which has nothing in it:
>
>
>> file = open("tmp","rb")
>> import numpy as num
>> num.fromfile(file,dtype=num.int16,count=1)
>>
>
> 1 items requested but only 0 read
> *** glibc detected *** /usr/bin/python: double free or corruption (fasttop):
> 0x08a5ac78 ***
>
>
> but on my other machine it does it well and just answers:
>
> 1 items requested but only 0 read
> Out[102]:array([], dtype=int16)
>
> Any hint why this fails?
>
>
This is fixed in SVN.
The problem is the behavior of realloc when size is 0 is not consistent
across platforms. In the one case it does not free the original memory,
but in the other it frees the memory.
-Travis O.
More information about the Numpy-discussion
mailing list