Opened 8 years ago
Closed 8 years ago
#4488 closed defect (fixed)
Simulation crash with optimization solver
| Reported by: | Owned by: | Martin Sjölund | |
|---|---|---|---|
| Priority: | blocker | Milestone: | 1.12.0 |
| Component: | Run-time | Version: | v1.12.0 |
| Keywords: | Cc: |
Description
Compilation was successfull, simulation gets next horror:
/tmp/OpenModelica_mikko/OMEdit/Modelicatesti -port=42296 -logFormat=xmltcp -override=startTime=0,stopTime=30,stepSize=0.06,tolerance=1e-06,solver=optimization,outputFormat=mat,variableFilter=.* -r=Modelicatesti_res.mat -w -lv=LOG_STATS
* Error in `/tmp/OpenModelica_mikko/OMEdit/Modelicatesti': double free or corruption (!prev): 0x081e8798 *
======= Backtrace: =========
/lib/i386-linux-gnu/libc.so.6(+0x67377)[0xb6dde377]
/lib/i386-linux-gnu/libc.so.6(+0x6d2f7)[0xb6de42f7]
/lib/i386-linux-gnu/libc.so.6(+0x6dc31)[0xb6de4c31]
/usr/lib/i686-linux-gnu/omc/libSimulationRuntimeC.so(+0x94290)[0xb773a290]
/usr/lib/i686-linux-gnu/omc/libSimulationRuntimeC.so(pickUpModelData+0x9d6)[0xb7738fb6]
Change History (6)
comment:1 by , 8 years ago
| Component: | OMEdit → Run-time |
|---|---|
| Owner: | changed from to |
| Status: | new → assigned |
comment:2 by , 8 years ago
comment:3 by , 8 years ago
My computer is i386, old but it's reserved for my test projects.
I'm sorry, I don't remember settings more than original post can tell. But there is the code what I tried to run. Very simple test but something went wrong. It's also possible that my computer/operating system was broken, I reinstalled it, used OM version "stable" and made similar model with OMEdit. It worked ok but this model crash..
/tmp/OpenModelica_mikko/OMEdit/Modelicatesti -port=44236 -logFormat=xmltcp -override=startTime=0,stopTime=30,stepSize=0.06,tolerance=1e-6,solver=optimization,outputFormat=mat,variableFilter=.* -r=Modelicatesti_res.mat -w -lv=LOG_STATS
model Modelicatesti
Modelica.Blocks.Sources.Step step1(startTime = 5) annotation(
Placement(visible = true, transformation(origin = {-72, 6}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Continuous.PID PID(Ti = 10, k = 7) annotation(
Placement(visible = true, transformation(origin = {2, 6}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Continuous.FirstOrder firstOrder1(k = 1) annotation(
Placement(visible = true, transformation(origin = {40, 6}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Math.Feedback feedback1 annotation(
Placement(visible = true, transformation(origin = {-38, 6}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
equation
connect(firstOrder1.y, feedback1.u2) annotation(
Line(points = {{52, 6}, {68, 6}, {68, -34}, {-38, -34}, {-38, -2}, {-38, -2}}, color = {0, 0, 127}));
connect(firstOrder1.u, PID.y) annotation(
Line(points = {{28, 6}, {12, 6}, {12, 6}, {14, 6}}, color = {0, 0, 127}));
connect(PID.u, feedback1.y) annotation(
Line(points = {{-10, 6}, {-30, 6}, {-30, 6}, {-28, 6}}, color = {0, 0, 127}));
connect(feedback1.u1, step1.y) annotation(
Line(points = {{-46, 6}, {-62, 6}, {-62, 6}, {-60, 6}}, color = {0, 0, 127}));
annotation(
uses(Modelica(version = "3.2.2")));
end Modelicatesti;
Result:
* Error in `/tmp/OpenModelica_mikko/OMEdit/Modelicatesti': double free or corruption (!prev): 0x098c6798 *
======= Backtrace: =========
/lib/i386-linux-gnu/libc.so.6(+0x67377)[0xb6dcd377]
/lib/i386-linux-gnu/libc.so.6(+0x6d2f7)[0xb6dd32f7]
/lib/i386-linux-gnu/libc.so.6(+0x6dc31)[0xb6dd3c31]
/usr/lib/i686-linux-gnu/omc/libSimulationRuntimeC.so(+0x94290)[0xb7762290]
/usr/lib/i686-linux-gnu/omc/libSimulationRuntimeC.so(pickUpModelData+0x9d6)[0xb7760fb6]
Maybe this help a little bit more? (Or not..)
comment:4 by , 8 years ago
And when I tested this code, it also started to crash model which was ok..
comment:5 by , 8 years ago
| Owner: | changed from to |
|---|---|
| Status: | assigned → accepted |
I can confirm it crashes on my machine as well, when using the optimization solver. valgrind --tool=memcheck also reports errors. I'll have a look later.
comment:6 by , 8 years ago
| Resolution: | → fixed |
|---|---|
| Status: | accepted → closed |
| Summary: | Simulation crash with Lubuntu16.04LTS → Simulation crash with optimization solver |
Fixed (added an error message saying -g=Optimica was not used, so the optimization solver failed to read the goal function, etc). You'll need to choose a different solver if you want to simulate the model (or setup an optimica model to run the optimization solver).

You need to attach the model and settings to the ticket so we can test it. It seems the crash is in the optimizer and you are running 32-bit Ubuntu, but that is all we can tell...