access violation in btCollisionWorld::updateSingleAabb

Sauce
Posts: 11
Joined: Fri Jun 04, 2010 11:33 am

access violation in btCollisionWorld::updateSingleAabb

Post by Sauce »

Hello!

Unfortunately i'm enduring a bit of pain trying to use Bullet here...

I'm getting an access violation inside of btCollisionWorld::updateSingleAABB on the line..

Code: Select all

colObj->getCollisionShape()->getAabb(colObj->getWorldTransform(), minAabb,maxAabb);
I've stepped into the function and it's crashing when the btCollisionShape returned by getCollisionShape() is dereferenced. The pointer returned by getCollisionShape is definitely valid before it's dereferenced. Is anyone else having this problem?

Here's the callstack:

Code: Select all

Ragdoll Demo.exe!btCollisionWorld::updateSingleAabb(btCollisionObject * colObj=0x07bc0940)  Line 146	C++
 Ragdoll Demo.exe!btCollisionWorld::updateAabbs()  Line 191	C++
 Ragdoll Demo.exe!btCollisionWorld::performDiscreteCollisionDetection()  Line 202 + 0xf bytes	C++
 Ragdoll Demo.exe!btDiscreteDynamicsWorld::internalSingleStepSimulation(float timeStep=0.016666668)  Line 318 + 0xf bytes	C++
 Ragdoll Demo.exe!btDiscreteDynamicsWorld::stepSimulation(float timeStep=78.492996, int maxSubSteps=10, float fixedTimeStep=0.016666668)  Line 281 + 0x19 bytes	C++
 Ragdoll Demo.exe!PhysicsManager::update(float deltaT=78.492996)  Line 112 + 0x2a bytes	C++
 Ragdoll Demo.exe!Application::doPhysics(float deltaT=78.492996)  Line 261	C++
 Ragdoll Demo.exe!Application::run()  Line 248 + 0x16 bytes	C++
 Ragdoll Demo.exe!main(int argc=1, char * * argv=0x0036b818)  Line 11	C++
 Ragdoll Demo.exe!__tmainCRTStartup()  Line 582 + 0x19 bytes	C
 Ragdoll Demo.exe!mainCRTStartup()  Line 399	C
 kernel32.dll!75ad3677() 	
 [Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]	
 ntdll.dll!77e39d72() 	
 ntdll.dll!77e39d45() 
edit: bullet version is 2.76
Sauce
Posts: 11
Joined: Fri Jun 04, 2010 11:33 am

Re: access violation in btCollisionWorld::updateSingleAabb

Post by Sauce »

nevermind, I was creating a plane and allocating the StaticPlaneShape on the stack and it went out of scope. I was under the impression that Bullet made a copy of the shape, apparently not!
lukethor
Posts: 3
Joined: Tue Mar 27, 2012 10:26 pm

Re: access violation in btCollisionWorld::updateSingleAabb

Post by lukethor »

Could you elaborate a bit more how you solve this problem