Page 1 of 1

SegFault when using initSystem in python [SOLVED]

Posted: Mon Oct 22, 2018 12:55 pm
by pariterre
Hello :)

I have a SegFault when I call the the initSystem method. Here is a minimalistic code that creates the problem here (Ubuntu 18.04, OpenSim compiled from the last commit of master branch in the superbuild mode with RelWithDebInfo).

model = osim.Model(f'{PATH_TO_OPENSIM_FOLDER}/Sandbox/MatlabScripts/gait2354_simbody.osim')
model.buildSystem()
model.initializeState()

Is that an "expected" behavior? (In the sense that I don't use the API properly?

Re: SegFault when using initSystem in python

Posted: Mon Oct 22, 2018 1:58 pm
by aymanh
Hi Benjamin,

Crashing quietly is not expected behavior, crashing for a reason should throw an exception with an informative message. Is this off-the-shelf model in 4.0? Keep in mind that the latest commit in master is bleeding edge and so it may not handle old files gracefully but would be very important to us to track down.

Do you get a stacktrace, and would you mind sharing it? Also why not just call initSystem() directly?

Thank you,
-Ayman

Re: SegFault when using initSystem in python

Posted: Tue Oct 23, 2018 7:11 am
by pariterre
Hi Ayman,

Thanks for your answer. I tried this code with 2 different models. The one we use (which is a Wu for Osim 3.3 that has been updated) and a random one in the Sandbox folder from master branch (I expected this one to work fine).

I unfortunately there is no stacktrace which is thrown. I just get a :
Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)

Re: SegFault when using initSystem in python

Posted: Tue Oct 23, 2018 7:56 am
by pariterre
I recompiled opensim on another computer and don't get anymore the segfault... I don't know what the problem was, but I think my conda environment was a bit messed up because of the ipopt installation (which interacted with the blas library)