Millard12EqWithAff.exe has stopped working

This project aims to provide muscle classes that incorporate afferent feedback from muscle spindles and Golgi tendon organs. This feedback is calculated during the simulation, so it can potentially be used to provide afferent information to a controller.

POST REPLY
User avatar
Stephanie Hachem
Posts: 34
Joined: Wed Oct 26, 2016 12:40 pm

Millard12EqWithAff.exe has stopped working

Post by Stephanie Hachem » Fri Dec 30, 2016 8:14 am

Hello,

I'm a student researcher, and have found the article corresponding to this software very useful. I think I'll find the software very useful as well, but I currently seem to be unable to run the generated .exes. I take the typical c++-to-executable steps for successfully running OpenSim exampleMain, etc., as I have before: build with CMake pointed to the source folder (and to a build folder within); open created solution folder in Visual Studio and build in RelWithDebug (the error is reproduced with Release) x64 (I'm using a 64-bit machine and processor, and used CMake's Visual Studio 14 2015 Win64 generator) configuration; and open the resulting .exe. However, if I open Millard12EqWithAff.exe in either the RelWithDebug or Release folders, a console window (like the window of command prompt) appears, as one would in successfully created exampleMain etc. programs, with the words 'MODEL: tugOfWar'. About a second later, a Windows window pops up with the header 'Millard12EqWithAff.exe has stopped working' and the text 'Windows is checking for a solution to the problem...'. After about one more second, the text changes to 'Windows is collecting more information about the problem. This might take several minutes...' and pretty much immediately after that, it becomes 'A problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available.'. Two buttons are at the bottom of the last screen, one to 'Debug' which opens the .exe in the Visual Studio debugging GUI, and another to 'Close Program'. I've reproduced the same issue on another computer with a 64-bit OS and processor running Windows 10, using OpenSim 3.3, CMake 3.6.3, and Visual Studio Community 2015 as my first computer did. The error also occurs using CMake 3.7.1 on my first computer. Now, if you choose 'Debug' and use the Visual Studio debugging GUI with a 'New instance of Microsoft Visual Studio 2015' as the debugger, you run into breaks very often with the error message:

'Unhandled exception at 0x00007FF95E25B5EB (msvcp120.dll) in Millard12EqWithAff.exe: 0xC0000005: Access violation reading location 0x0000000000000000.

If there is a handler for this exception, the program may be safely continued.'

If you were to press continue after this break and for other breaks, I noticed the message is sometimes just:

'Exception thrown at 0x00007FF95E25B5EB (msvcp120.dll) in Millard12EqWithAff.exe: 0xC0000005: Access violation reading location 0x0000000000000000.

If there is a handler for this exception, the program may be safely continued.'

I've found forums where this error message signifies pointer/null issues such as having null pointers passed to run-time functions or having variables which weren't previously initialized null.

I will continue to work on the problem, but wanted to let you know in case this is a widespread issue, and since you're probably more familiar with the code (and code in general) than me and thus I believe you could find any null pointer issues much faster than me.

Thanks,

User avatar
Sergio Verduzco-Flores
Posts: 9
Joined: Wed May 23, 2012 3:55 pm

Re: Millard12EqWithAff.exe has stopped working

Post by Sergio Verduzco-Flores » Wed Jan 25, 2017 12:15 am

Hello Stefani.
I wrote a response to your email, but I haven't seen any replies. Posting here in case you didn't get the email.
I was asking if you were able to compile the model from the Customized Muscle Model tutorial (http://simtk-confluence.stanford.edu:80 ... scle+Model)
-Sergio

User avatar
Stephanie Hachem
Posts: 34
Joined: Wed Oct 26, 2016 12:40 pm

Re: Millard12EqWithAff.exe has stopped working

Post by Stephanie Hachem » Sun Jan 29, 2017 12:46 pm

Hello,

Yes, I've been able to compile the Building a Customized Muscle Model example version for OpenSim 3.3 <http://simtk-confluence.stanford.edu:80 ... scle+Model>. That is to say, I can build the Muscle Model's ALL_BUILD in Release or RelWithDebInfo configuration, however in Debug configuration, I encounter LINK errors as described in the OpenSim forum (my entry is the last one, on page 3 of <viewtopicPhpbb.php?f=91&t=5314&p=0&start=20&view=>) building ALL_BUILD. The same error comes up building mainAfferent.cpp ALL_BUILD: with Release or RelWithDebInfo, it builds smoothly but then crashes when the .exe is run as described above, while in Debug, it doesn't build but gives the same LINK errors. Currently, I'm not able to debug the Millard12EqWithAff.exe generated by building mainAfferents in Release and RelWithDebInfo very well considering I don't have the debug build, although the debug build error seems to be a problem I'm having with OpenSim 3.3, not just the Afferents download.

Do you have any ideas on what I should do?

Stephanie

User avatar
Sergio Verduzco-Flores
Posts: 9
Joined: Wed May 23, 2012 3:55 pm

Re: Millard12EqWithAff.exe has stopped working

Post by Sergio Verduzco-Flores » Mon Jan 30, 2017 10:54 pm

Stefani,

I don't think you need to build in Debug mode.

I couldn't do it either, since you need some files that are not distributed with OpenSim. Building in RelWithDebInfo should suffice for most purposes.

I don't know what is causing your errors. I'll try to give you some pointers.
  • If you haven't done it, start from the simplest tutorials (e.g. http://simtk-confluence.stanford.edu:80 ... ep+Example) so you can gradually rule out sources of error.
  • When I first did the tutorials, I had obscure errors about dynamic libraries that couldn't be found. To solve this I had to build OpenSim from source (http://simtk-confluence.stanford.edu:80 ... rom+Source) . For this, I first had to build SimBody from source.
    I didn't have any problems, just followed the instructions, and made sure I compiled compatible versions of OpenSim and Simbody using the the right generator (e.g. OpenSim 3.3, Simbody 3.5.3 or 3.5.4, VS 14 2015, RelWithDebInfo).
  • After compiling OpenSim and Simbody I had some libraries that weren't found, but that was solved easily. Please see the bottom posts here:
    viewtopicPhpbb.php?f=91&t=6403&amp%3bsi ... 0944d0c819
    Also, make sure OpenSim's /bin folder is in your PATH variable.
  • You can't compile the GUI from source, so I just downloaded the binaries. This worked fine.
  • When you compile my code, first try to use the same configuration I had. I think you're already doing this, but do use VS 14 2015 .
If you manage to properly compile OpenSim from source, and complete the Custom Muscle tutorial, then any further errors should be specific to my code. Please let me know what you find.

User avatar
Stephanie Hachem
Posts: 34
Joined: Wed Oct 26, 2016 12:40 pm

Re: Millard12EqWithAff.exe has stopped working

Post by Stephanie Hachem » Tue Feb 07, 2017 6:56 pm

Hello,

I have gotten the programs to run, and they produce the folder (MuscleAnalysisResults) and files in line with those specified in the README. I attained the results through commenting out the line of code above the line which Visual Studio's debugger said was throwing an error (in mainAfferents.cpp, the line said to throw the error was 250, and I commented out the line 'osimModel.printDetailedInfo(si, std::cout);' (line 247)). I did this after working through the examples, and had the error 'x.exe has stopped working' occur with the ControllerExample, which was also fixed by commenting out the same call; therefore, this error is likely because of something I did wrong in my own configuration/build process with OpenSim. The fix was probably the first thing I should've tried... in any case, sorry for making all this ruckus. I hope this forum post can help someone who may have ran into the same error as me.

Thanks,
Stephanie

POST REPLY