SegFault when using initSystem in python [SOLVED]

The 2018 Fall Virtual Workshop will bring together a group of international scholars and OpenSim experts to help each other advance their research using modeling and simulation. This forum is a place to accelerate OpenSim based projects while also buildin
POST REPLY
User avatar
Benjamin Michaud
Posts: 31
Joined: Mon May 03, 2010 6:35 am

SegFault when using initSystem in python [SOLVED]

Post by Benjamin Michaud » Mon Oct 22, 2018 12:55 pm

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?
Last edited by Benjamin Michaud on Tue Oct 23, 2018 7:56 am, edited 1 time in total.

User avatar
Ayman Habib
Posts: 2235
Joined: Fri Apr 01, 2005 12:24 pm

Re: SegFault when using initSystem in python

Post by Ayman Habib » Mon Oct 22, 2018 1:58 pm

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

User avatar
Benjamin Michaud
Posts: 31
Joined: Mon May 03, 2010 6:35 am

Re: SegFault when using initSystem in python

Post by Benjamin Michaud » Tue Oct 23, 2018 7:11 am

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)

User avatar
Benjamin Michaud
Posts: 31
Joined: Mon May 03, 2010 6:35 am

Re: SegFault when using initSystem in python

Post by Benjamin Michaud » Tue Oct 23, 2018 7:56 am

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)

POST REPLY