Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

soft-body simulation hangs with ConfigFlag.VF_SS #35

Open
stephengold opened this issue May 6, 2023 · 5 comments
Open

soft-body simulation hangs with ConfigFlag.VF_SS #35

stephengold opened this issue May 6, 2023 · 5 comments

Comments

@stephengold
Copy link
Owner

This issue was reported by Tharg, using the HelloSoftBody tutorial app with VF_SS set.

Here is a native stack (from GDB):

(gdb) bt
#0  0x00007f75f30c1d35 in buildTreeBottomUp (leafNodes=..., adj=...)
    at /home/travis/build/stephengold/Libbulletjme/src/main/native/bullet3/BulletSoftBody/btSoftBody.cpp:85
#1  0x00007f75f30d206e in btSoftBody::rebuildNodeTree (this=0x7f75c0b680b0)
    at /home/travis/build/stephengold/Libbulletjme/src/main/native/bullet3/BulletSoftBody/btSoftBody.cpp:2729
#2  0x00007f75f30d1b7a in btSoftBody::initializeFaceTree (this=0x7f75c0b680b0)
    at /home/travis/build/stephengold/Libbulletjme/src/main/native/bullet3/BulletSoftBody/btSoftBody.cpp:2693
#3  0x00007f75f30ce6cb in btSoftBody::predictMotion (this=0x7f75c0b680b0, 
    dt=0.0166666675)
    at /home/travis/build/stephengold/Libbulletjme/src/main/native/bullet3/BulletSoftBody/btSoftBody.cpp:2111
#4  0x00007f75f3336ee5 in btDefaultSoftBodySolver::predictMotion (
    this=0x7f75c0b51f60, timeStep=0.0166666675)
    at /home/travis/build/stephengold/Libbulletjme/src/main/native/bullet3/BulletSoftBody/btDefaultSoftBodySolver.cpp:143
#5  0x00007f75f32e1e5f in btSoftRigidDynamicsWorld::predictUnconstraintMotion (
    this=0x7f75c0b10160, timeStep=0.0166666675)
    at /home/travis/build/stephengold/Libbulletjme/src/main/native/bullet3/BulletSoftBody/btSoftRigidDynamicsWorld.cpp:74
#6  0x00007f75f32fe8f5 in btDiscreteDynamicsWorld::internalSingleStepSimulation
    (this=0x7f75c0b10160, timeStep=0.0166666675)
    at /home/travis/build/stephengold/Libbulletjme/src/main/native/bullet3/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp:463
#7  0x00007f75f32e1f2d in btSoftRigidDynamicsWorld::internalSingleStepSimulation (this=0x7f75c0b10160, timeStep=0.0166666675)
    at /home/travis/build/stephengold/Libbulletjme/src/main/native/bullet3/BulletSoftBody/btSoftRigidDynamicsWorld.cpp:88
@stephengold
Copy link
Owner Author

TODO:

  1. Verify this is the first simulation step.
  2. Verify N = 2459

@stephengold
Copy link
Owner Author

Actually, N = 4914.

Then newLeafNodes.size() = 2597, then 1398, then 773, then 455, then 290, then 203, then 156, ...

It eventually gets to 1, but then buildTreeBottomUp() gets invoked again (on the same simulation step), and that's when the hang occurs.

Note that buildTreeBottomUp() is invoked from initializeFaceTree() the 1st time and then from rebuildNodeTree() the 2nd time, both times on the same soft body.

The 2nd time, N seems to be stuck at 2459.

@stephengold
Copy link
Owner Author

The 2nd time, adj is based on the soft body's links, but the body has zero links!

@stephengold
Copy link
Owner Author

Adding links to the body resolves this issue. I'll add an option to the SoftBodyControl constructor.

@stephengold
Copy link
Owner Author

Added at b2cd333

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant