Chipmunk 6.0 Beta

Official forum for the Chipmunk2D Physics Library.

Re: Chipmunk 6.0 Beta

Postby funkaster » Fri Apr 15, 2011 11:55 am

I'm testing the 6.0 beta and it's working just fine... the only problem I'm facing right now is random crashes when calling cpSpacePointQueryFirst (for a touch joint). I've tracked the problem and it happens the second time I create a space (for instance, the level 2 of a game), and it's because of this line:

Code: Select all
static inline   void
cpSpatialIndexPointQuery(cpSpatialIndex *index, cpVect point, cpSpatialIndexQueryFunc func, void *data)
{
   index->klass->pointQuery(index, point, func, data);
}


basically, index is corrupted: some times klass->pointQuery is NULL, others, just index is NULL.
I'm using svn revision 742. Any idea why the pointQuery pointer function might be null?

thanks!
funkaster
 
Posts: 7
Joined: Mon Dec 22, 2008 5:22 pm

Re: Chipmunk 6.0 Beta

Postby slembcke » Fri Apr 15, 2011 12:19 pm

I'm guessing that in all cases that the index pointer is invalid. The only place in Chipmunk where that is called is in cpSpacePointQuery() where it passes cpSpace.activeShapes and cpSpace.staticShapes to it. If either of those was a bad pointer, there should be terrible crashes when cpSpaceStep() is called. So I'm not quite sure what could be causing the crash you are seeing.

Out of curiosity, is it crashing on the static or active shapes index in cpSPacePointQuery()?
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
slembcke
Site Admin
 
Posts: 4164
Joined: Tue Aug 14, 2007 7:13 pm

Re: Chipmunk 6.0 Beta

Postby funkaster » Sun Apr 17, 2011 3:16 pm

nah... nevermind, :oops: my bad: I was keeping an invalid object (touch delegate -cocos2d-) around, with a rotten pointer to an old space, that's why there was a problem.
Anyway... so far, so good! 6.x is looking really great!
funkaster
 
Posts: 7
Joined: Mon Dec 22, 2008 5:22 pm

Re: Chipmunk 6.0 Beta

Postby akamal » Thu Apr 21, 2011 3:11 pm

In 6.0, we have memory leaks at
cpBody *
cpBodyNewStatic()
{
return cpBodyInitStatic(cpBodyAlloc());
}

in cpBodyAlloc().

This happens only with static bodies, which we create, not with space->staticBody.
akamal
 
Posts: 15
Joined: Fri Mar 11, 2011 3:32 pm

Re: Chipmunk 6.0 Beta

Postby slembcke » Thu Apr 21, 2011 3:49 pm

Where is the memory leak exactly?
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
slembcke
Site Admin
 
Posts: 4164
Joined: Tue Aug 14, 2007 7:13 pm

Re: Chipmunk 6.0 Beta

Postby akamal » Thu Apr 21, 2011 4:04 pm

My bad, I was releasing all space->bodies at the end. I missed that space->bodies contain only active Bodies. I should keep track of all staticBodies allocated also, so that I can release them later.
akamal
 
Posts: 15
Joined: Fri Mar 11, 2011 3:32 pm

Re: Chipmunk 6.0 Beta

Postby JavierTapulous » Thu May 12, 2011 2:59 pm

I've been using revision 742 for quite some time and it's rock solid.
JavierTapulous
 
Posts: 13
Joined: Fri Apr 01, 2011 3:17 pm

Re: Chipmunk 6.0 Beta

Postby slembcke » Thu May 12, 2011 4:18 pm

Awesome. Good to hear. I admittedly haven't done a lot of testing on Chipmunk 6 other than a lot of demo/toys and a smallish set of unit tests. It's definitely helpful that people are playing with the beta even though there is pretty much zero documentation on what has changed.

We are a week or two away (hopefully) from being done with the Disney contract we've been working on. Definitely been crunching for the last few weeks. Once that is done I want to spend a few days to wrap up the Chipmunk 6 documentation and get it released. After that I want to spend a couple of weeks making some new example code and tutorials as Chipmunk has definitely been lacking in that area.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
slembcke
Site Admin
 
Posts: 4164
Joined: Tue Aug 14, 2007 7:13 pm

Re: Chipmunk 6.0 Beta

Postby dieterweb » Wed May 18, 2011 5:16 am

Hi Scott,

finally we switched to Chipmunk 6 for one of our new projects. I do not have to add that this will stress your engine to the max :)

So far it looks all good.

Can you add the patch you made to set a rogue body static (viewtopic.php?f=1&t=1211&st=0&sk=t&sd=a&start=10) to chipmunk 6?

Thomas
Visit our game Blog: http://zombiesmash.gamedrs.com or follow us on twitter: http://twitter.com/zombiesmash
dieterweb
 
Posts: 176
Joined: Fri Feb 27, 2009 7:12 am
Location: Germany

Re: Chipmunk 6.0 Beta

Postby slembcke » Wed May 18, 2011 8:39 am

Oh yeah, I forgot about that. I think I have most of those changes integrated into mainstream Chipmunk, just not the rouge -> static function. I'll take a look at that today.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
slembcke
Site Admin
 
Posts: 4164
Joined: Tue Aug 14, 2007 7:13 pm

PreviousNext

Return to Chipmunk2D Physics

Who is online

Users browsing this forum: No registered users and 4 guests