CIF simulator crashes on large expressions
Today I was contacted by a modeler with a crash report when he tried to run a simulation. Part of the crash report is shown below. As you can see below, some piece of Java code is too large to be properly compiled.
It turns out that the synthesized supervisor that was being synthesized had an extremely long guard. And this guard could be reduced significantly by performing forward reachability. I have seen similar situations before while TA-ing with the course in Eindhoven.
Since this is not the first time I have seen this problem, I think
- we could include this compilation error into the end-user documentation and refer users to that if we encouter a compilation error,
- maybe we could issue a warning when the input model contains a very large expression. I don't know whether we can easily determine the 'size' of an expression.
[Exception]
java.lang.RuntimeException: Compilation error.
at org.eclipse.escet.cif.simulator.compiler.CifCompilerContext.compile(CifCompilerContext.java:1532)
at org.eclipse.escet.cif.simulator.compiler.CifCompiler.compileSpec(CifCompiler.java:114)
at org.eclipse.escet.cif.simulator.compiler.CifCompiler.compileSpec(CifCompiler.java:63)
at org.eclipse.escet.cif.simulator.CifSimulator.loadSpec(CifSimulator.java:475)
at org.eclipse.escet.cif.simulator.CifSimulator.simulateInternal(CifSimulator.java:216)
at org.eclipse.escet.cif.simulator.CifSimulator.simulate(CifSimulator.java:115)
at org.eclipse.escet.cif.simulator.CifSimulatorApp.runInternal(CifSimulatorApp.java:146)
at org.eclipse.escet.common.app.framework.Application.run(Application.java:343)
at org.eclipse.escet.common.app.framework.ChildAppStarter$1.run(ChildAppStarter.java:281)
at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: org.eclipse.escet.common.app.framework.javacompiler.RuntimeJavaCompilerException: Run-time Java code compilation failed (with 38 source files):
with output (0):
with diagnostics (6):
line 118, column 15: ERROR: code too large for try statement
line 114, column 24: ERROR: code too large
line 139, column 15: ERROR: code too large for try statement
line 135, column 24: ERROR: code too large
line 160, column 15: ERROR: code too large for try statement
line 156, column 24: ERROR: code too large
at org.eclipse.escet.common.app.framework.javacompiler.RuntimeJavaCompiler.compile(RuntimeJavaCompiler.java:235)
at org.eclipse.escet.cif.simulator.compiler.CifCompilerContext.compile(CifCompilerContext.java:1530)
... 9 more
[Application]
Application name = CIF simulator
Application version = 0.9.0.v20230331-102453
Application class = org.eclipse.escet.cif.simulator.CifSimulatorApp