[Numpy-discussion] Error in deallocation ?

Matthieu Brucher matthieu.brucher at gmail.com
Wed Oct 17 08:34:17 EDT 2007


>
> 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.
>

The error showed up again with a simple operation :
  File "/home/brucher/local/src/include/toolbox/stats/kernels/gaussian.py",
line 60, in __call__
    xp = (x-self.loc) * (1/self.scale)
Where x and self.loc are arrays abd self.scale is an integer.

The error as it was given :

*** Reference count error detected:
an attempt was made to deallocate 7 (l) ***
*** Reference count error detected:
an attempt was made to deallocate 7 (l) ***
*** Reference count error detected:
an attempt was made to deallocate 7 (l) ***

I don't know if it is too many INCREF, but I doubt it. It happens in a loop
where I treat a bunch of 3D images each time (64*64*64*3), and it crashes
after some dozens of them. I have no problem when I treat small 2D images
(128*128), but far more samples.


Matthieu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20071017/88441726/attachment.html>


More information about the NumPy-Discussion mailing list