[ODE] Memory Leak

Jaroslav Sinecky jsinecky at tiscali.cz
Fri Dec 23 01:08:19 MST 2005

Well this is really surprising to me because I was conviced there are no
dynamic memory allocations inside ode colliders or solver. But in
collision_trimesh_ccylinder.cpp there is one! And effectively, the
deallocation is skipped in early exit test on line 1018:

	 if (! Collider.GetContactStatus()) {
	 	// no collision occurred
	 	return 0;

So this is the leak. I would suggest to use ode-style stack allocation or
static buffer like in cylinder_trimesh for example. But by the way, looking
at it, in cylinder_trimesh there is a static buffer for 32 contacts but this
limit is never checked against, so I think it's easily possible for this
buffer to overflow if your cylinder collides with lot of triangles at the
same time. Seems pretty dangers to me...

Putting this in SF bug tracker ...


> -----Original Message-----
> From: ode-bounces at q12.org [mailto:ode-bounces at q12.org]On Behalf
> Of Christopher Fraser
> Sent: Friday, December 23, 2005 12:56 PM
> To: ode at q12.org
> Subject: Re: [ODE] Memory Leak
> I discovered it only leaks memory when using ccylinders for the
> wheels. Doesnt
> happen with spheres.
> This is against a trimesh ground. I tested this out after reading
> an article
> here:
> http://www.blitzbasic.com/Community/posts.php?topic=52572
> Where they mentioned a ccylinder trimesh memory leak.
> For now i am using spheres, and there is no leak now.
> Why do ccylinders leak memory on a trimesh?
> Thanks, Christopher
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode

More information about the ODE mailing list