Infinite loop in b2World::SolveTOI

Hello,

I'm a member of the Stencyl team and we use the Alchemy port of Box2D available with the WCK.

Lately, our users have had several problems caused by Box2D when CCD is enabled. The Flash player freezes and eventually spits out an error. We found out the engine enters an infinite loop in b2World::SolveTOI. After some research I found out this was bug that was fixed when Erin Catto migrated the project to Google Code.

Box2D topic: viewtopic.php?f=4&t=3549
Google Code issue: http://code.google.com/p/box2d/issues/detail?id=1&can=1
Diff (around line 640): http://code.google.com/p/box2d/source/d ... 2World.cpp
WCK's b2World.cpp: https://github.com/jesses/wck/blob/mast ... 2World.cpp

If you compare the source code in the diff to the one used by the WCK, you'll see they are quite different. I suppose the bug was fixed at a much later stage of Box2D. Some things were dropped, others were introduced.

I naively tried to replicated the fix on our end but it had no impact at all.


Is there a way to fix the infinite TOI loop in WCK?


Thanks for reading. Any hint or advice is welcome.
Thanks for doing the "hard" research before reporting this. I was going to wait until the new Alchemy came out to make any updates but you made this pretty easy. I'll get it in my first chance.

Quote:
I naively tried to replicated the fix on our end but it had no impact at all.


Did you actually recompile the C++ / SWC? I was just going to update the C++ code, recompile & commit, but did you already try this with no success in fixing the bug?
If by "recompile the C++ / SWC" you mean run the project through Alchemy, then yes I did it.

Thank you for looking into this.

Original thread: https://box2d.org/forum/viewtopic.php?t=8035