Dynamic box on kinematic platform gets flung off

When I put a dynamic box on a downward moving kinematic platform, sometimes the box gets stuck in a rotated position. As soon as the platform stops moving, the box gets flung off a very large distance for no apparent reason.

Edit: I also had another body that somehow went through the platform and was flung downwards.
There was a bug with kinematic bodies. It should be fixed in the latest SVN version.
I updated to the latest version, and the flinging bug is fixed. Unfortunately, the game now freezes when a dynamic box gets caught in a closing (kinematic) door.

For some reason, it only happens with optimization turned on. Which is even worse in a way, since optimization isn't supposed to change the actual behavior of the program. Is there any undefined behavior in Box2d?
http://code.google.com/p/box2d/issues/detail?id=143

Currently you can get an infinite loop if you create an insolvable problem for continuous physics.

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