Skip to content
This repository was archived by the owner on May 18, 2019. It is now read-only.

Handle errors during FMI initialization #1110

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sjoelund
Copy link
Member

@sjoelund sjoelund commented Oct 7, 2016

No description provided.

@OpenModelica-Hudson
Copy link
Member

The test suite is unstable according to OpenModelica_TEST_PULL_REQUEST 2016-10-07_08-16-20.

@OpenModelica-Hudson
Copy link
Member

The test suite is unstable according to OpenModelica_TEST_PULL_REQUEST 2017-10-02_11-49-39.

MMC_CATCH_INTERNAL(mmc_jumper)
if (!fmi2callbacksOK) {
return NULL;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks a bit strange. The if condition will always fail since fmi2callbacksOK is set to 1 unless you are doing something in MMC_CATCH_INTERNAL which is of course not the case since fmi2callbacksOK is local.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not weird. It's setjmp/longjmp. The assignment to fmi2callbacksOK doesn't occur if an error is triggered.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, it's a bit wrong since it returns before restoring the jump buffer. But a bigger problem is that when OM imports the FMU, we use thread-local storage for the threadData and we need to have separate threadData for the importing model... This seems to be what causes the crashes. Maybe we need to make the simulation check for existing threadData and re-use that...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants