[Numpy-discussion] Error in deallocation ?

Travis E. Oliphant oliphant@enthought....
Mon Oct 15 14:35:45 CDT 2007


Matthieu Brucher wrote:
>
>     The problem is that there is a data-type reference counting error some
>     where that is attempting to deallocate the built-in data-type 'l' 
>
>
>
> That's what I supposed, but I couldn't find the reason why it wanted 
> to do this
>  
>
>     It's not really a Python error but a logging.  The code won't let you
>     deallocate the built-ins, but it will tell you that something
>     tried to.
>
>     Reference counting on data-types is easy to get wrong
>     (particularly with
>     Pyrex extension modules) because most calls consume a reference to the
>     data-type (if they return an object that  contains a reference to the
>     data-type).
>
>     It is a bug, and it would be nice to figure it out, but that would
>     require the code that caused it.
>
>
> I've updated my numpy version to the latest svn, the behaviour seems 
> to be different (more warnings), I'll try to give more information 
> about the error, but giving the whole code will not be simple (it uses 
> a big data file that seems to trigger the error as with other data 
> files, the error didn't show up :()
>

There are two types of errors that can occur with reference counting on 
data-types. 

1) There are too many DECREF's --- this gets us to the error quickly and 
is usually easy to reproduce
2) There are too many INCREF's (the reference count keeps going up until 
the internal counter wraps around to 0 and deallocation is attempted) 
--- this error is harder to reproduce and usually takes a while before 
it happens in the code.


-Travis



More information about the Numpy-discussion mailing list