John Glover | 4 Aug 13:03 2010
Picon

Problem with PyODE object deallocation and XODE changes

Hello,

I'm working on a Google Summer of Code project on PaGMO
(http://sourceforge.net/apps/mediawiki/pagmo) where I need to
instantiate a large number of similar ODE worlds and objects running
in multithreaded environment. I ran into a problem with Python garbage
collection of some of the objects. Basically it seemed that sometimes
a world was being deallocated, calling dBodyDestroy and deallocating
memory for a body, but the Python object was still calling its own
dealloc and bodyDestroy (with a similar problem for Joints), and
crashing with a segmentation fault.

I have code that can reproduce it on OS X 10.5 with Python 2.6.5, but
the same code doesn't crash with the same Python version on Ubuntu, so
it could be something strange with Python garbage collection on the
Mac. However, the following minor fix sorts the problem out, so I was
hoping that it would be possible to get it checked in, unless someone
has an alternative.

cvs diff: Diffing src
Index: src/body.pyx
===================================================================
RCS file: /cvsroot/pyode/pyode/src/body.pyx,v
retrieving revision 1.8
diff -r1.8 body.pyx
59c59
<         if self.bid!=NULL:
---
>         if self.bid!=NULL and self.world:
Index: src/joints.pyx
(Continue reading)

Ethan Glasser-Camp | 26 Sep 21:20 2010
Picon

Re: Problem with PyODE object deallocation and XODE changes

On 08/04/2010 07:03 AM, John Glover wrote:
> I have code that can reproduce it on OS X 10.5 with Python 2.6.5, but
> the same code doesn't crash with the same Python version on Ubuntu, so
> it could be something strange with Python garbage collection on the
> Mac. However, the following minor fix sorts the problem out, so I was
> hoping that it would be possible to get it checked in, unless someone
> has an alternative.
>    

Hi. Is it possible for you to resend these patches as unified diff (diff 
-u) and as attachments? I'll check them in for you.

Ethan

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev

Gmane