Simulation Problem: btAssert let application crash

spy32
Posts: 19
Joined: Fri Aug 01, 2008 1:12 pm

Simulation Problem: btAssert let application crash

Post by spy32 »

Hi bullet community,
I am using bullet as physics api(Yes! Really! :-) ) , but after about 45 secs my Application crashes: The following console output appears:
peakbin: ./src/LinearMath/btQuaternion.h:134: btQuaternion& btQuaternion::operator/=(const btScalar&): Assertion `s != btScalar(0.0)' failed.

Program received signal SIGABRT, Aborted.
[Switching to Thread 0xb6a056e0 (LWP 7369)]
0xb7f9c410 in __kernel_vsyscall ()
So that's my full backtrace:
(gdb) backtrace
#0 0xb7f9c410 in __kernel_vsyscall ()
#1 0xb7b9c085 in raise () from /lib/tls/i686/cmov/libc.so.6
#2 0xb7b9da01 in abort () from /lib/tls/i686/cmov/libc.so.6
#3 0xb7b9510e in __assert_fail () from /lib/tls/i686/cmov/libc.so.6
#4 0x080abdca in btRigidBody::predictIntegratedTransform ()
#5 0x081000cc in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
I hope you know what's going on there. I don't have more information :( . I don't know , whether this is a bug or whether this is my mistake. Can I turn off btAssert in this case somehow?

Best Regards,
spy32
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Simulation Problem: btAssert let application crash

Post by Erwin Coumans »

There is not enough information to determine what is going wrong. The assert should stay there, it is important to solve the cause of the problem instead.

Most likely the input/initialization of objects passed into Bullet is invalid at some stage.

Thanks,
Erwin
spy32
Posts: 19
Joined: Fri Aug 01, 2008 1:12 pm

Re: Simulation Problem: btAssert let application crash

Post by spy32 »

Hm, I dont know, do you need the code? Okay here we go: Hm, that's a little problem . because I code with a big engine. Maybe I should take as long as no error occurs anymore objects from the game. So I can see which object is BAD.
ThomasS
Posts: 3
Joined: Thu Jul 31, 2008 11:31 am

Re: Simulation Problem: btAssert let application crash

Post by ThomasS »

Today I've got exactly the same bug in my game. The reason for the crash was that I was calling rigidBody->setAngularVelocity(vector) with the vector's components all being nan. Perhaps you have something similar in your code?
sparkprime
Posts: 508
Joined: Fri May 30, 2008 2:51 am
Location: Ossining, New York

Re: Simulation Problem: btAssert let application crash

Post by sparkprime »

Should there be checks in the API for that sort of thing (perhaps optional ones)?