[Pyrex] pyrex 0.9.4.1 bugs?

Greg Ewing greg.ewing at canterbury.ac.nz
Thu Aug 17 02:01:00 UTC 2006


Chris Bainbridge wrote:

> cdef class World:
>     def __new__(self):
>         self.objectlist = []
> 
>     def __dealloc__(self):
>         if self.objectlist:
>             for o in self.objectlist:
>                 o._destroyed()
> 
> It compiles fine, but I get bad reads reported by valgrind at runtime.
> If I do the objectlist init in the __init__ function rather than
> __new__ then everything is fine.

I don't know what's going on there. Can you tell whether
the bad reads are happening during __new__ or during
__dealloc__? Or somewhere else?

One thing to watch out for is what o._destroyed() could
be doing. If it results in the object whose __dealloc__
is executing being touched in any way, bad things could
happen.

--
Greg



More information about the Pyrex mailing list