Opened 5 years ago

Closed 5 years ago

#5603 closed defect (invalid)

OMEdit crashes on opening record with array creation in ternary operator

Reported by: robert.sandmann@… Owned by: Adrian Pop
Priority: critical Milestone: Future
Component: Frontend Version: v1.14.0-dev-nightly
Keywords: Cc:

Description (last modified by Adrian Pop)

Dear developer team,

when I open the following two files:
ErrorRecord.mo

record ErrorRecord
  parameter Boolean someBool = true;
  final parameter Real someValue = 0.05;
  parameter SimpleRecord simpleRecord(recordValue1 = someValue - simpleRecord.recordValue2);
  final parameter Real[1] crash = if true then {1} else array(simpleRecord.recordValue2 for i in 1:1) annotation (Dialog(enable=someBool));
end ErrorRecord;

and
SimpleRecord.mo

record SimpleRecord
  parameter Real recordValue1 = 1;
  parameter Real recordValue2 = 1;
end SimpleRecord;

in OMEdit and I double click on ErrorRecord.mo, OMEdit crashes.
Oddly enough, if I change some things in ErrorRecord.mo, OMEdit doesn't crash. Those changes are:

  • line 4: Change enable=someBool to enable=true in the annotation
  • line 4: Remove the annotation alltogether
  • line 5: Remove the definition of recordValue
  • line 5: Remove someValue from the definition of recordValue

Can you reproduce this behaviour? I'm using the new frontend with -d=newInst

Any help is much appreciated!

Change History (6)

comment:1 by Francesco Casella, 5 years ago

Owner: changed from somebody to Adrian Pop
Priority: highcritical
Status: newassigned

@adrpo, not sure if this is a nfAPI, old API, or NF issue. Can you please have a look and dispatch to the appropriate person?

Thanks!

comment:2 by Adrian Pop, 5 years ago

Description: modified (diff)
Status: assignedaccepted

comment:3 by Adrian Pop, 5 years ago

I cannot reproduce this. With or without -d=nfAPI is the same, double click on it in OMEdit opens it. I will try again with a new build.

comment:4 by Adrian Pop, 5 years ago

Robert, do you have some additional OMEdit flags in Tools->Options->Simulation besides -d=newInst?

comment:5 by anonymous, 5 years ago

Hello Adrian, thank you so much for responding so quickly! I am incredibly sorry.. I opened the model in an older 1.14.0-nightly, with the latest it's working like a charm.
Again, excuse me for any headaches I may have caused and thanks again for looking into it!

comment:6 by Francesco Casella, 5 years ago

Resolution: invalid
Status: acceptedclosed
Note: See TracTickets for help on using tickets.