Opened 9 years ago

Closed 6 years ago

#3779 closed defect (fixed)

Wrong generated code for a model of the Buildings library

Reported by: mwetter Owned by: somebody
Priority: high Milestone: 1.14.0
Component: Run-time Version:
Keywords: Cc:

Description

The following commands give a segmentation fault on Ubuntu 14.04, 64 bit:

$ export OPENMODELICALIBRARY=pwd:/usr/lib/omlibrary
$ omc +d=nogen,initialization,backenddaeinfo,discreteinfo,stateselection openmod.mos

where openmod.mos has the content:

system("rm -f Buildings_* Buildings.* Modelica_*");
loadModel(Modelica, {"3.2.1"});
getErrorString();
loadModel(Buildings); getErrorString();

simulate(Buildings.Fluid.Storage.Validation.HeatExchangerDynamics);

// division by zero (but model seems OK) simulate(Buildings.Fluid.HeatExchangers.Examples.DryEffectivenessNTUMassFlow);

system("rm -f Buildings_* Buildings.* Modelica_*");

Change History (3)

comment:1 Changed 7 years ago by casella

  • Component changed from *unknown* to Run-time
  • Milestone changed from Future to 1.13.0
  • Summary changed from segmentation fault in simulateModel to Wrong generated code for a model of the Buildings library

Looking at the report in https://test.openmodelica.org/libraries/Buildings/files/Buildings.Fluid.Storage.Validation.HeatExchangerDynamics.err

Buildings.Fluid.Storage.Validation.HeatExchangerDynamics_06inz.c:3823:45: error: use of undeclared identifier '$PtanDyn$PQHex_flow_nominal'
  data->simulationInfo->realParameter[86] = $PtanDyn$PQHex_flow_nominal;
                                            ^
Buildings.Fluid.Storage.Validation.HeatExchangerDynamics_06inz.c:4934:46: error: use of undeclared identifier '$PtanSte$PQHex_flow_nominal'
  data->simulationInfo->realParameter[772] = $PtanSte$PQHex_flow_nominal;
                                             ^
Buildings.Fluid.Storage.Validation.HeatExchangerDynamics_06inz.c:50824:45: error: use of undeclared identifier '$PtanDyn$PQHex_flow_nominal'
  data->simulationInfo->realParameter[86] = $PtanDyn$PQHex_flow_nominal;
                                            ^
Buildings.Fluid.Storage.Validation.HeatExchangerDynamics_06inz.c:51935:46: error: use of undeclared identifier '$PtanSte$PQHex_flow_nominal'
  data->simulationInfo->realParameter[772] = $PtanSte$PQHex_flow_nominal;

it seems that we still have a problem with the generated code. No segfault, though.

comment:2 Changed 6 years ago by casella

  • Milestone changed from 1.13.0 to 1.14.0

Rescheduled to 1.14.0 after 1.13.0 releasee

comment:3 Changed 6 years ago by casella

  • Resolution set to fixed
  • Status changed from new to closed

This issue has been solved in the new front end a long time ago. The model currently fails because of #5238

Note: See TracTickets for help on using tickets.