Ammo.js Out of bounds memory access

In our game we often get a fatal out of bounds memory error related to ammo.js. I don’t yet know how to reproduce it, but it happens quite often.

I have tracked it down to the step simulation function on btDiscreteDynamicsWorld.
It happens on this line:

xf(e,a,c,d)

Unminified:

return _emscripten_bind_btDiscreteDynamicsWorld_stepSimulation_3(self, timeStep, maxSubSteps, fixedTimeStep);

Posting this to see if anyone has any ideas on how to tackle this.

Hi @joshb,

Is there any chance you are using too large mesh colliders? Too many polygons that would be.

That’s a common cause for that error, you may need to either build Ammo with a higher max memory limit or reduce your colliders (if that’s the case).

Could be. I’ll investigate and report back.

1 Like