Segfault on initSystem

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
User avatar
Christopher Dembia
Posts: 506
Joined: Fri Oct 12, 2012 4:09 pm

Re: Segfault on initSystem

Post by Christopher Dembia » Fri Mar 04, 2016 9:19 am

Jim Stanev has had a similar issue; see https://simtk.org/forums/viewtopic.php? ... nev#p15196.

Maybe try adding `find_package(Simbody)` to your CMakeLists.txt (and also make sure it finds the correct Simbody).

User avatar
Leonardo Consoni
Posts: 2
Joined: Wed Nov 18, 2015 4:34 am

Re: Segfault on initSystem

Post by Leonardo Consoni » Thu Apr 21, 2016 8:18 am

I'm having a plain segfault on initSystem as well, for SimTK 3.5.3 and OpenSim 3.3 release libraries on a small test program, on Arch Linux 64-bit.

Based on the comments here, I tried to build a debug version of the libraries and use it on my program (confirmed the debug libraries are being linked with ldd). Now I'm getting the following error on initSystem:

"[...]include/simbody/internal/common.h:95: bool SimTK::MobilizedBodyIndex::operator<(int) const: Assertion `isValidExtended() && isValidExtended(i)' failed."

Is this related to the error reported on this topic ?

Edit: Found out that the assertion problem was caused by an issue in the model, so please ignore it. Besides, after some testing, the segfault was gone when I disabled the optimizations (-Ox ) for the release build of OpenSim libraries (SimTK is fine with -O2).

POST REPLY