You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/**@brief Inversely scale this quaternion
* @param s The scale factor */
btQuaternion& operator/=(const btScalar& s)
{
btAssert(s != btScalar(0.0));// <<<===Omitting this line cause the bug
return *this *= btScalar(1.0) / s;
}
And compiling Bullet3 on debug64 mode(gmake, gcc 4.9.2, linux64), the "Constraints" demo in ExampleBrowser crush, here is gdb:
$ gdb ./App_ExampleBrowser_gmake_x64_debug
GNU gdb (Debian 7.7.1+dfsg-5) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./App_ExampleBrowser_gmake_x64_debug...done.
(gdb) run
Starting program: /home/tal/src/bullet3/bin/App_ExampleBrowser_gmake_x64_debug
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffef83b700 (LWP 13067)]
Creating context
Created GL 3.0 context
Direct GLX rendering context obtained
Making context current
GL_VENDOR=X.Org
GL_RENDERER=Gallium 0.4 on AMD JUNIPER
GL_VERSION=3.3 (Core Profile) Mesa 10.3.2
GL_SHADING_LANGUAGE_VERSION=3.30
pthread_getconcurrency()=0
b3Printf: Selected demo: Constraints
ven = X.Org
App_ExampleBrowser_gmake_x64_debug: ../../src/LinearMath/btVector3.h:300: btVector3& btVector3::normalize(): Assertion `!fuzzyZero()' failed.
Program received signal SIGABRT, Aborted.
0x00007ffff65bc107 in __GI_raise (sig=sig@entry=6)
at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0 0x00007ffff65bc107 in __GI_raise (sig=sig@entry=6)
at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1 0x00007ffff65bd4e8 in __GI_abort () at abort.c:89
#2 0x00007ffff65b5226 in __assert_fail_base (
fmt=0x7ffff66ebce8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n",
assertion=assertion@entry=0x723480 "!fuzzyZero()",
file=file@entry=0x723368 "../../src/LinearMath/btVector3.h",
line=line@entry=300,
function=function@entry=0x7cf000 <_ZZN9btVector39normalizeEvE19__PRETTY_FUNCTION__> "btVector3& btVector3::normalize()") at assert.c:92
#3 0x00007ffff65b52d2 in __GI___assert_fail (
assertion=0x723480 "!fuzzyZero()",
file=0x723368 "../../src/LinearMath/btVector3.h", line=300,
function=0x7cf000 <_ZZN9btVector39normalizeEvE19__PRETTY_FUNCTION__> "btVector3& btVector3::normalize()") at assert.c:101
#4 0x000000000040b1c0 in btVector3::normalize (this=0x7fffffffda10)
at ../../src/LinearMath/btVector3.h:300
#5 0x000000000057e946 in normalize (this=0x7fffffffda10)
at ../../src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp:891
#6 btConeTwistConstraint::computeConeLimitInfo (this=0x1260a30, qCone=...,
swingAngle=@0x7fffffffd9e8: 0.000690533954, vSwingAxis=...,
swingLimit=@0x7fffffffd9ec: 0)
at ../../src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp:838
---Type <return> to continue, or q <return> to quit---
#7 0x0000000000581210 in btConeTwistConstraint::calcAngleInfo2 (
this=this@entry=0x1260a30, transA=..., transB=..., invInertiaWorldA=...,
invInertiaWorldB=...)
at ../../src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp:675
#8 0x0000000000581d3c in btConeTwistConstraint::getInfo1 (this=0x1260a30,
info=0x12ed510)
at ../../src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp:90
#9 0x000000000058e07f in btSequentialImpulseConstraintSolver::solveGroupCacheFriendlySetup (this=0x1259470, bodies=<optimized out>,
numBodies=<optimized out>, manifoldPtr=0x12ed730, numManifolds=21,
constraints=0x12ed570, numConstraints=15, infoGlobal=...,
debugDrawer=0x1254d70)
at ../../src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp:1332
#10 0x00000000005886b5 in btSequentialImpulseConstraintSolver::solveGroup (
this=0x1259470, bodies=0x12ed610, numBodies=18, manifoldPtr=0x12ed730,
numManifolds=21, constraints=0x12ed570, numConstraints=15, infoGlobal=...,
debugDrawer=0x1254d70)
at ../../src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp:1917
#11 0x0000000000577c18 in processConstraints (this=0x1259860)
at ../../src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp:192
#12 btDiscreteDynamicsWorld::solveConstraints (this=0x12595e0, solverInfo=...)
---Type <return> to continue, or q <return> to quit---
at ../../src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp:736
#13 0x00000000005768d2 in btDiscreteDynamicsWorld::internalSingleStepSimulation
(this=0x12595e0, timeStep=0.0166666675)
at ../../src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp:506
#14 0x000000000056f9c2 in btDiscreteDynamicsWorld::stepSimulation (
this=0x12595e0, timeStep=0.0377589986, maxSubSteps=<optimized out>,
fixedTimeStep=0.0166666675)
at ../../src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp:456
#15 0x0000000000417ac5 in OpenGLExampleBrowser::update (this=<optimized out>,
deltaTime=0.0377589986)
at ../../examples/ExampleBrowser/OpenGLExampleBrowser.cpp:871
#16 0x000000000040ea80 in main (argc=<optimized out>, argv=0x7fffffffe348)
at ../../examples/ExampleBrowser/main.cpp:34
(gdb)
After analyzing the problem, it is caused when normalizing quaternion, which call the "/=" operator that I changed above. The "/=" op has a precession error in this situation, which yields to epsilon quaternion, which is shown in the back trace.
I've seen this issue while on my Bullet3 C API fork (while merging original branch).
It is weird that btAssert() is saving the precession.
This might even be a compiler bug, but I'm not sure.
It might be the cause for #180
Please try my change test and tell me if you have crush in debug64 mode.
This discussion was converted from issue #412 on April 26, 2021 03:52.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
If I omit this line in LinearMath/btQuaternion.h:
And compiling Bullet3 on debug64 mode(gmake, gcc 4.9.2, linux64), the "Constraints" demo in ExampleBrowser crush, here is gdb:
After analyzing the problem, it is caused when normalizing quaternion, which call the "/=" operator that I changed above. The "/=" op has a precession error in this situation, which yields to epsilon quaternion, which is shown in the back trace.
I've seen this issue while on my Bullet3 C API fork (while merging original branch).
It is weird that btAssert() is saving the precession.
This might even be a compiler bug, but I'm not sure.
It might be the cause for #180
Please try my change test and tell me if you have crush in debug64 mode.
Beta Was this translation helpful? Give feedback.
All reactions