Open AnHeuermann opened 11 months ago
I'm not sure what exactly the issue is, but I guess it has something to do with the long jump function used when throwing an assert in the C code of the FMU:
static void omc_assert_fmi(threadData_t *threadData, FILE_INFO info, const char *msg, ...)
{
va_list args;
va_start(args, msg);
omc_assert_fmi_common(threadData, fmi2Error, LOG_STATUSERROR, info, msg, args);
va_end(args);
MMC_THROW_INTERNAL(); // <---- EXCEPTION_ACCESS_VIOLATION
}
#define MMC_THROW_INTERNAL() {longjmp(*threadData->mmc_jumper,1);}
The issue happens on Windows and Linux, so I rule out some compatibility issues between the different C runtimes on Windows.
On Ubuntu the call stack looks like:
libc.so.6!__libc_siglongjmp(struct __jmp_buf_tag * env, int val) (longjmp.c:32)
Modelica_Fluid_Examples_PumpingSystem.so!omc_assert_fmi(threadData_t * threadData, FILE_INFO info, const char * msg) (\path\to\temp\FMU\sources\fmi-export\fmu2_model_interface.c.inc:228)
Modelica_Fluid_Examples_PumpingSystem.so!omc_Modelica_Media_Water_IF97__Utilities_BaseIF97_Basic_tsat(threadData_t * threadData, modelica_real _p) (\path\to\temp\FMU\sources\Modelica_Fluid_Examples_PumpingSystem_functions.c:13630)
[...]
Issue
I added regression tests for OpenModelica and they are testing some OpenModelica FMUs with FMI.jl.
For model
Modelica.Fluid.Examples.PumpingSystem
FMI.jl is crashing when simulating the generated FMU and an assert is encountered.OMSimulator is triggering the assert as well, but finishes the simulation with success.
How to reproduce
Windows FMU with debug symbols (remove the .zip extension): Modelica.Fluid.Examples.PumpingSystem.fmu.zip
Error log: error.log
Versions 'n stuff