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

grtfmi.tlc FMU crashes after fmi2Reset #211

Closed
patengel opened this issue Sep 15, 2020 · 0 comments
Closed

grtfmi.tlc FMU crashes after fmi2Reset #211

patengel opened this issue Sep 15, 2020 · 0 comments
Labels
bug Something isn't working GRT This issue is related to the GRT based FMU export

Comments

@patengel
Copy link

Hi,

every FMU we built with the grtfmi target shows the following problem:

  • The FMU works fine until fmi2Reset is called the first time. Afterwards some of the following fmi calls crashes.
  • Everything works fine if we replace fmi2Reset by fmi2FreeInstance + fmi2Instantiate.

We have tested lately with FMIKit 2.8 RC 1 and it was still not working. We have tested both Matlab 2018b and 2019b. All FMIKit settings are unchanged, therefore default.

Up to my analysis the problem are dangling pointers:

  • The ModelInstance struct contains fields "modelVariables", which contain references into the model itself "S".
  • In fmi2Instantiate these pointers are set by initializeModelVariables(instance->S, instance->modelVariables);.
  • In fmi2Reset, the model itself "S" is rebuilt, but the pointers are not reset and therefore dangling from now on.

In my opinion the problem could be fixed by calling initializeModelVariables also inside fmi2Reset.

Best,
Patrick

@t-sommer t-sommer added bug Something isn't working GRT This issue is related to the GRT based FMU export labels Sep 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working GRT This issue is related to the GRT based FMU export
Projects
None yet
Development

No branches or pull requests

2 participants