Memory leak and other issues
Posted: Sat Nov 17, 2007 3:34 am
In the process of integrating Bullet 2.64 into our engine most things have worked very smoothly, but I came across a few issues that look like bugs, so I thought I'd pass them on.
One of the "new"s was not converted to a placement new during the 2.64 upgrade which should cause a mem leak for anyone using the MultiSap broadphase. In btMultiSapBroadphase.cpp line 83 the line currently reads:
should probably be changed to:
Next, I found that the hash used for overlapping pairs only uses one of the proxy ids rather than both. This seems odd and contradicts the comments immediately before the function. At btOverlappingPairCache.h line 180:
likely should be:
I encountered an crash when using btBvhTriangleMeshShape as the btBvhTriangleMeshShape::processAllTriangles calls back through the btStridingMeshInterface->getLockedReadOnlyVertexIndexBase() method, which lets you specify the format of your triangle indices as a PHY_ScalarType. It then access the data as an integer causing very bad things to happen if you provided an array of shorts. At a minimum this should assert, preferably of course it should support all formats listed in the enum.
While not necessarily a bug, there are a few includes that use the system path for Bullet files. This is inconsistent with the majority of the code base and is annoying if you are using a development environment that doesn't search the user include path for system includes by default.
btDiscreteDynamicsWorld.cpp line 24 : #include <LinearMath/btTransformUtil.h>
btSimpleBroadphase.cpp line 17: #include <BulletCollision/BroadphaseCollision/btDispatcher.h>
btSimpleBroadphase.cpp line 18: #include <BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h>
btPolyhedralConvexShape.cpp line 16 : #include <BulletCollision/CollisionShapes/btPolyhedralConvexShape.h>
btGjkEpa.cpp line 29 : #include <LinearMath/btStackAlloc.h>
I hope the above are helpful. Overall I've been quite please with Bullet and expect to continue using it. Thanks for all the good work.
Best regards,
Stephen
One of the "new"s was not converted to a placement new during the 2.64 upgrade which should cause a mem leak for anyone using the MultiSap broadphase. In btMultiSapBroadphase.cpp line 83 the line currently reads:
Code: Select all
btChildProxy* childProxyRef = new btChildProxy();
Code: Select all
btChildProxy* childProxyRef = new (mem) btChildProxy();
Code: Select all
int key = ((unsigned int)proxyId1) | (((unsigned int)proxyId1) <<16);
Code: Select all
int key = ((unsigned int)proxyId1) | (((unsigned int)proxyId2) <<16);
While not necessarily a bug, there are a few includes that use the system path for Bullet files. This is inconsistent with the majority of the code base and is annoying if you are using a development environment that doesn't search the user include path for system includes by default.
btDiscreteDynamicsWorld.cpp line 24 : #include <LinearMath/btTransformUtil.h>
btSimpleBroadphase.cpp line 17: #include <BulletCollision/BroadphaseCollision/btDispatcher.h>
btSimpleBroadphase.cpp line 18: #include <BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h>
btPolyhedralConvexShape.cpp line 16 : #include <BulletCollision/CollisionShapes/btPolyhedralConvexShape.h>
btGjkEpa.cpp line 29 : #include <LinearMath/btStackAlloc.h>
I hope the above are helpful. Overall I've been quite please with Bullet and expect to continue using it. Thanks for all the good work.
Best regards,
Stephen