﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
2840	Segmentation fault if assertion fails in FMU	Rüdiger Franke	Willi Braun	"The following model contains an assertion that fails during the simulation with a constant input u = -2 after 0.1 seconds.
{{{
model DIC ""Double Integrator Continuous-time""
  parameter Real p = 1 ""gain for input"";
  parameter Real y1_start = 1 ""start value for first state"";
  parameter Real y2_start = 0 ""start value for second state"";
  input Real u(start = -2);
  output Real y1, y2;
initial equation
  y1 = y1_start;
  y2 = y2_start;
equation
  assert(y2 < 0.1, ""y2 must be smaller than 0.1"");
  der(y1) = p * u;
  der(y2) = y1;
end DIC;
}}}
Exported as FMU 2.0 with the omc command:
{{{
translateModelFMU(DIC, version=""2.0"");
}}}
the assertion causes:
{{{
assert            | debug   | y2 must be smaller than 0.1
Segmentation fault
}}}
This is bad if a numerical solver happens to exceed the allowed limits and has no chance to correct, e.g. with a smaller step size. 

Shouldn't the respective FMU function just issue a log message and return an error?

Is there possibly a translation option to completely disable assertions, like the compilation of a C program without DEBUG flag?

I checked the documentation, but didn't get an answer there: `OpenModelicaUsersGuide.pdf` doesn't mention options for translateModelFMU and the scripting documentation at
  https://build.openmodelica.org/Documentation/OpenModelica.Scripting.html
doesn't mention translateModelFMU at all :-(
"	defect	closed	high	1.9.1	FMI	trunk	fixed		Willi Braun Adrian Pop
