Opened 10 years ago

Closed 10 years ago

#2762 closed defect (fixed)

Process crashed -- Simulation process exited with code 0

Reported by: rfranke@… Owned by: Willi Braun
Priority: high Milestone: 1.9.1
Component: Code Generation Version: trunk
Keywords: simulation crash Cc: Adrian Pop

Description

The model listed below uses the same variables as outputs and states (like some models from the MSL, see Modelica.Blocks.Continuous.Integrator).

Opened and simulated with OMEdit, the compilation raises a lot of warnings and the simulation crashes.

The observation has been made with the current nightly build 1.9.1+dev (r21649).

within ;
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
  der(y1) = p*u;
  der(y2) = y1;
end DIC;

Attachments (1)

boehm-gc.suppressions (11.4 KB ) - added by Martin Sjölund 10 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 by Lennart Ochel, 10 years ago

Status: newaccepted

comment:2 by Lennart Ochel, 10 years ago

Cc: Adrian Pop added

This seems to be an issue with the garbage collector. Adrian, can you have a look?

==15946== Conditional jump or move depends on uninitialised value(s)
==15946==    at 0x6339B0F: GC_push_all_eager (in trunk/build/lib/omc/libgc.so.1.0.3)
==15946==    by 0x6343A3D: GC_with_callee_saves_pushed (in trunk/build/lib/omc/libgc.so.1.0.3)
==15946==    by 0x633B16D: GC_push_roots (in trunk/build/lib/omc/libgc.so.1.0.3)
==15946==    by 0x633A9A8: GC_mark_some (in trunk/build/lib/omc/libgc.so.1.0.3)
==15946==    by 0x633232C: GC_stopped_mark (in trunk/build/lib/omc/libgc.so.1.0.3)
==15946==    by 0x63325DA: GC_try_to_collect_inner (in trunk/build/lib/omc/libgc.so.1.0.3)
==15946==    by 0x633D24D: GC_init (in trunk/build/lib/omc/libgc.so.1.0.3)
==15946==    by 0x4E5A0DF: mmc_init (mmc_gc.h:79)
==15946==    by 0x660D3FF: pthread_once (pthread_once.S:104)
==15946==    by 0x405871: main (in DIC)

comment:3 by Martin Sjölund, 10 years ago

No. If you run valgrind you need to suppress GC errors, like so:

[martin@mega tmp]$ cat ~/bin/valgrind-boehm && valgrind-boehm ./DIC 
#!/bin/bash
valgrind --suppressions="$HOME/.valgrind/boehm-gc.suppressions" $*
==1956== Memcheck, a memory error detector
==1956== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==1956== Using Valgrind-3.10.0.SVN and LibVEX; rerun with -h for copyright info
==1956== Command: ./DIC
==1956== 
==1956== Invalid write of size 4
==1956==    at 0x4050F1: DIC_initialAnalyticJacobianA (in /home/martin/tmp/DIC)
==1956==    by 0x4E93FF4: dassl_initial (dassl.c:235)
==1956==    by 0x4EA1238: initializeSolverData (solver_main.c:184)
==1956==    by 0x4EA22D1: solver_main (solver_main.c:570)
==1956==    by 0x4ED2BA2: callSolver (simulation_runtime.cpp:695)
==1956==    by 0x4ED143D: startNonInteractiveSimulation (simulation_runtime.cpp:548)
==1956==    by 0x4ED3FB8: _main_SimulationRuntime (simulation_runtime.cpp:914)
==1956==    by 0x403C4C: main (in /home/martin/tmp/DIC)
...

by Martin Sjölund, 10 years ago

Attachment: boehm-gc.suppressions added

in reply to:  3 comment:4 by Lennart Ochel, 10 years ago

Owner: changed from Lennart Ochel to Willi Braun
Status: acceptedassigned

Replying to sjoelund.se:

No. If you run valgrind you need to suppress GC errors, like so:

Ahh – good to know.

comment:5 by Willi Braun, 10 years ago

Status: assignedaccepted

comment:6 by Willi Braun, 10 years ago

Resolution: fixed
Status: acceptedclosed

fixed in r21660.

Note: See TracTickets for help on using tickets.