Opened 12 years ago

Last modified 7 years ago

#1842 assigned defect

Illegal redeclare should be rejected by the NF with appropriate error message

Reported by: julian.wyszynski Owned by: Per Östlund
Priority: high Milestone: 2.1.0
Component: New Instantiation Version:
Keywords: Cc:

Description

Model "Nitri1" in attached Package results in "Stack Overflow Error" when instantiating in OMShell.
When deleting line 33 "package Test = WasteWater.ASMx;" omc.exe crashes.

This structure is used a lot in our Library and is working in Dymola. It would be nice if it would run in OpenModelica (or at least a similar structure).

Attachments (1)

StackOverflowError.mo (1.0 KB ) - added by julian.wyszynski 12 years ago.
Package showing Error

Download all attachments as: .zip

Change History (17)

by julian.wyszynski, 12 years ago

Attachment: StackOverflowError.mo added

Package showing Error

comment:1 by Willi Braun, 12 years ago

Component: BackendFrontend
Owner: changed from somebody to Willi Braun
Status: newaccepted

comment:2 by Martin Sjölund, 12 years ago

Owner: changed from Willi Braun to Per Östlund
Status: acceptedassigned

comment:3 by Per Östlund, 12 years ago

The model is not legal Modelica, since it contains extends which are not transitively non-replaceable (section 7.1.4 in the Modelica 3.3 specification). E.g. Nitri1 extends from JModel2 which extends from AerationModel, which is both replaceable and contains replaceable components. Modelica does not allow classes that you extend from to be replaceable, or to contain replaceable elements. Dymola supports this anyway but shows warnings for it, but implementing this language extension in OpenModelica is currently not a priority.

Of course, the compiler shouldn't get stack overflows, so we need to detect this case and print a proper error message for this.

comment:4 by Martin Sjölund, 11 years ago

Milestone: 1.9.01.9.1

Postponed until 1.9.1

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

Milestone: 1.9.11.9.2

This ticket was not closed for 1.9.1, which has now been released. It was batch modified for milestone 1.9.2 (but maybe an empty milestone was more appropriate; feel free to change it).

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

Milestone: 1.9.21.9.3

Milestone changed to 1.9.3 since 1.9.2 was released.

comment:7 by Martin Sjölund, 9 years ago

Milestone: 1.9.31.9.4

Moved to new milestone 1.9.4

comment:8 by Martin Sjölund, 9 years ago

Milestone: 1.9.41.9.5

Milestone pushed to 1.9.5

comment:9 by Martin Sjölund, 9 years ago

Milestone: 1.9.51.10.0

Milestone renamed

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

Milestone: 1.10.01.11.0

Ticket retargeted after milestone closed

comment:11 by Martin Sjölund, 8 years ago

Milestone: 1.11.01.12.0

Milestone moved to 1.12.0 due to 1.11.0 already being released.

comment:12 by Henning Kiel, 8 years ago

Is this fixed? I ran

loadFile("StackOverflowError.mo");getErrorString();
simulate(StackOverflowError.ASMx.GenericUnits.Nitri1);getErrorString();

and it simulated without any error or stack overflow.

comment:13 by Francesco Casella, 7 years ago

Component: FrontendNew Instantiation
Milestone: 1.12.0Future

The stack overflow seems to be fixed, but according to comment:3, this model should be rejected by the compiler, or at least one warning should be generated

comment:14 by Francesco Casella, 7 years ago

Summary: Stack Overflow ErrorIllegal redeclare should be rejected by the NF

Changed the ticket summary to better reflect the current situation.

As of v1.13.0-dev-672-g87286cb84, the following error is obtained with the new front end

[1] 18:57:41 Translation Error
[StackOverflowError: 22:9-22:75]: Base class AerationCommon not found in scope JModel2.

I'm not sure if this mode failure is the expected one. @perost, can you please comment on that?

in reply to:  14 comment:15 by Per Östlund, 7 years ago

Replying to casella:

I'm not sure if this mode failure is the expected one. @perost, can you please comment on that?

The error message should be improved, but the model is not expected to work as per my previous comment.

comment:16 by Francesco Casella, 7 years ago

Milestone: Future2.1.0
Summary: Illegal redeclare should be rejected by the NFIllegal redeclare should be rejected by the NF with appropriate error message

Updated issue summary and postponed to 2.1.0

Note: See TracTickets for help on using tickets.