/usr/bin/python: double free or corruption

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

/usr/bin/python: double free or corruption

emsellem (Bugzilla)
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?

thanks!

Eric

extra INFO :
============
The machine where it does not work is 32bit, and:
matplotlib version 0.91.2
platform is linux2
numerix numpy 1.0.4
backend GTKAgg version 2.10.6
Python 2.5.1 (r251:54863, Jan 10 2008, 18:01:57
IPython 0.8.1 -- An enhanced Interactive Python.
_______________________________________________
Numpy-discussion mailing list
[hidden email]
http://projects.scipy.org/mailman/listinfo/numpy-discussion
Reply | Threaded
Open this post in threaded view
|

Re: /usr/bin/python: double free or corruption

Travis Oliphant-5
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.



_______________________________________________
Numpy-discussion mailing list
[hidden email]
http://projects.scipy.org/mailman/listinfo/numpy-discussion