Frequent asserts in multi-thread dispatching after 2.82
Posted: Wed Mar 12, 2014 7:33 pm
I am seeing very frequent asserts (4 per pair per tick) when using a multi-threaded dispatcher that is related to a recent change from 2.81 to 2.82. The code that is directly causing the asserts was added in r2637. This does not happen in a single-threaded model.
The full path to the asserts starts in SpuCatheringCollisionTask.cpp around line 727 in ProcessSpuConvexConvexCollision() where two btConvexPointCloudShape are created on the stack. New btConvexPointCloudShape objects have m_isLocalAabbValid set to false by default. And the setPoints() function is invoked such that AABB recalculation is disabled. When these stack objects are eventually passed on to btGjkPairDetector::getClosestPoints() they have not had recalcLocalAabb() called and m_isLocalAabbValid is still false. This is causing the asserts to arise in the new code from r2637 which invokes getAabb() (line 454/457) on those collision objects.
I can work around this for now by setting m_fixContactNormalDirection in btGjkPairDetector to false. But I'd rather not since the description on the fix sounds rather important.
BTW, thanks for the great work on Bullet.
The full path to the asserts starts in SpuCatheringCollisionTask.cpp around line 727 in ProcessSpuConvexConvexCollision() where two btConvexPointCloudShape are created on the stack. New btConvexPointCloudShape objects have m_isLocalAabbValid set to false by default. And the setPoints() function is invoked such that AABB recalculation is disabled. When these stack objects are eventually passed on to btGjkPairDetector::getClosestPoints() they have not had recalcLocalAabb() called and m_isLocalAabbValid is still false. This is causing the asserts to arise in the new code from r2637 which invokes getAabb() (line 454/457) on those collision objects.
I can work around this for now by setting m_fixContactNormalDirection in btGjkPairDetector to false. But I'd rather not since the description on the fix sounds rather important.
BTW, thanks for the great work on Bullet.