Closed RedBreadcat closed 7 months ago
The qbvh::refit
should not freeze (and, more generally, the query pipeline’s update should never fail). This is a bug in the QBVH update code.
I wasn’t able to reproduce the bug with the provided code, but, other similar issues were reported and a fix just got merged in https://github.com/dimforge/parry/pull/185. So I’m closing this issue, but, feel free to open a new issue if this happens again.
The following code softlocks within
physics.step();
in the loop, after "Step: 9" is printed. The freeze does not occur ifself.query_pipeline.update(&self.bodies, &self.colliders);
is uncommented.It was a bit difficult to figure out what was happening, as the freeze only occurred when rigidbodies were in certain positions. (If a == b, I could not trigger a freeze). If possible, it would be nice if the code panicked, or a more elegant solution that made it impossible for one to forget to update the QueryPipeline.
The freeze itself occurred inside this function call: https://github.com/dimforge/rapier/blob/1a4183cc94acc3210e4ae467abbea7d68e51c5ff/src/pipeline/query_pipeline.rs#L349
In more complex code that periodically deleted rigidbodies and colliders, and had dynamic physics objects too, I occasionally panicked inside the closure on the next line, due to the handle's two internal integer components being huge numbers that looked like uninitialized memory.
Thank you for your work!