Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault during simulation of rectifier using negative Start Time #9241

Closed
christiankral opened this issue Jul 18, 2022 · 3 comments · Fixed by #9243
Closed

Segmentation fault during simulation of rectifier using negative Start Time #9241

christiankral opened this issue Jul 18, 2022 · 3 comments · Fixed by #9243
Assignees
Milestone

Comments

@christiankral
Copy link

christiankral commented Jul 18, 2022

Description

When I simulate the included thyristor bridge model using a current source, the simulation works OK if the simulation Start Time is set to zero. If I pick the Start Time = -1s

image

the simulation process crashes:

Process crashed Simulation process failed. Exited with code 11.
Process crashed

Limited backtrace at point of segmentation fault
/lib/x86_64-linux-gnu/libpthread.so.0(+0x14420)[0x7fac173f5420]
/usr/bin/../lib/x86_64-linux-gnu/omc/libSimulationRuntimeC.so(cleanValueListbyTime+0x39)[0x7fac1b39e3d6]
/usr/bin/../lib/x86_64-linux-gnu/omc/libSimulationRuntimeC.so(cleanUpOldValueListAfterEvent+0x42)[0x7fac1b3a0f76]
/tmp/OpenModelica_christian/OMEdit/B2/B2(B2_performSimulation+0x8df)[0x407f2f]
/usr/bin/../lib/x86_64-linux-gnu/omc/libSimulationRuntimeC.so(solver_main+0x3b9)[0x7fac1b3ac14b]
/usr/bin/../lib/x86_64-linux-gnu/omc/libSimulationRuntimeC.so(+0x1f9b33)[0x7fac1b401b33]
/usr/bin/../lib/x86_64-linux-gnu/omc/libSimulationRuntimeC.so(startNonInteractiveSimulation+0xb56)[0x7fac1b400f62]
/usr/bin/../lib/x86_64-linux-gnu/omc/libSimulationRuntimeC.so(_main_SimulationRuntime+0x72)[0x7fac1b403230]
/tmp/OpenModelica_christian/OMEdit/B2/B2(main+0x1f2)[0x40abf4]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0x7fac17211083]
/tmp/OpenModelica_christian/OMEdit/B2/B2(_start+0x2e)[0x40758e]

Steps to Reproduce

Simulate the following model:

within ;
model B2
  import Modelica.Units.SI;
  import Modelica.Constants.pi;
  extends
    Modelica.Electrical.PowerConverters.Examples.ACDC.ExampleTemplates.ThyristorBridge2Pulse(
      Vrms=100,
      sinevoltage(startTime=-1));
  extends Modelica.Icons.Example;
  parameter SI.Current id = 5 "Load current";
  Modelica.Electrical.Analog.Sources.ConstantCurrent constantCurrent(I=id)
    annotation (Placement(transformation(
        extent={{-10,-10},{10,10}},
        rotation=270,
        origin={20,10})));
equation
  connect(constantCurrent.p, voltagesensor.p) annotation (Line(points={{20,20},{
          20,40},{50,40},{50,20}}, color={0,0,255}));
  connect(constantCurrent.n, currentSensor.p)
    annotation (Line(points={{20,0},{20,-40},{10,-40}}, color={0,0,255}));
  annotation (experiment(
      StartTime=-1,
      StopTime=0.02,
      Tolerance=1e-06, Interval = 0.0002), uses(Modelica(version="4.0.0")));
end B2;

Additional comment

The simulation did not crash if I simulate Modelica.Blocks.Examples.Filter with Start Time = -1s.

Version and OS

Connected to OpenModelica 1.20.0~dev-222-g2c88f03
Connected to OMSimulator Linux Mint 20.3, 64bit
@casella casella added this to the 1.20.0 milestone Jul 18, 2022
@casella
Copy link
Contributor

casella commented Jul 18, 2022

Given the MWE and the stack trace, finding the cause of the problem shouldn't be too difficult. @AnHeuermann, @phannebohm please have a look at your earliest convenience.

phannebohm added a commit to phannebohm/OpenModelica that referenced this issue Jul 18, 2022
phannebohm added a commit to phannebohm/OpenModelica that referenced this issue Jul 18, 2022
phannebohm added a commit to phannebohm/OpenModelica that referenced this issue Jul 18, 2022
AnHeuermann pushed a commit that referenced this issue Jul 18, 2022
@casella
Copy link
Contributor

casella commented Jul 19, 2022

Thanks @phannebohm! ❤️

@christiankral please check with the next nightly build and confirm that all works well now.

@christiankral
Copy link
Author

I confirm that everything works as expected. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants