Opened 6 years ago

Closed 6 years ago

#5048 closed defect (fixed)

Wrong error messages

Reported by: massimo ceraolo Owned by: Adeel Asghar
Priority: blocker Milestone: 1.14.0
Component: OMEdit Version:
Keywords: Cc: Adrian Pop

Description (last modified by massimo ceraolo)

I suppose a program user should take seriously error and warning messages to avoid bigger issues.
Therefore I suppose any false error message should be corrected.

In this ticket I describe a few error messages that are probably invalid.

1) opening message under Linux
message when opening OMEdit under linux (OMEdit 1.13.0~dev-137-g0e9c2ff
Connected to OpenModelica 1.13.0~dev-1195-g6d891ea)
When I open OMEdt I receive the following error message:

[1] 03:46:50 Scripting Error
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile

I don't know what this means and implies. I would say that this massage has no impact on the user's experience: I think it should be either be removed or made clearer for the final user.

2) message when duplicating (tested on Connected to OpenModelica 1.13.0~dev-1195-g6d891ea under Linux, and on OMEdit v1.13.0-dev-113-g8c6364e6 (64-bit)
Connected to v1.13.0-dev-640-gff8188090 (64-bit) under Windows)

Currently OMEdit shows a strange message whenever we duplicate a model in a package.
The issue can be replicated considering the attached Test.mo.
If we duplicate RL1 giving for instance to the duplicated class the name RL2, I receive the following error message:

[1] 21:18:40 Syntax Error
[: 1:0-1:0]: No viable alternative near token: C

[2] 21:18:40 Translation Error
[: 0:0-0:0]: Internal error Failed to scan top of input: EOF
  Expected one of: <EOF>
  Current parse tree is:   The parser stack is:

It seems to me that no error occurred while duplication. So, probably this error message is just wrong

3) Opening file under Linux (tested on OMEdit 1.13.0~dev-205-g65f0077
Connected to OpenModelica 1.13.0~dev-1371-gc7f4444)
Open test.mo file using Open Model/Library Files(s) menu command.
The following error message is displayed in red:

[1] 09:03:39 Scripting Error
Gtk-Message: 09:03:35.599: GtkDialog mapped without a transient parent. This is discouraged.

It seems a false error, which is not displayed when loading the same file from the recent Files list.
BTW, I don't understand the meaning of this message, but I would say that something that is just discouraged should be more a warning than an error.

4) flange_a falsely reported as missing
If we open Modelica.Mechanics.Translational.Examples.Friction in diagram mode we don't see flanges on stop1 and stop2. If we simulate it we get the following error messages:

[1] 08:53:49 Scripting Error
Unable to find component stop2.flange_a while parsing connection {spring.flange_b,stop2.flange_a,}.

[2] 08:53:49 Scripting Error
Unable to find component stop1.flange_a while parsing connection {force.flange,stop1.flange_a,}.

Nevertheless, the model compiles and runs correctly. Using Dymola we do see flanges on stop1 and stop2, and don't see any error message.

5) Opening message under Mac OS
The issue is described in ticket #5122.
As far as I remember also this is a false error since, despite it, OM works normally (cannot check now because currently my Mac installation is broken).

Attachments (2)

Test.mo (1.7 KB ) - added by massimo ceraolo 6 years ago.
script.mos (850 bytes ) - added by Adeel Asghar 6 years ago.

Download all attachments as: .zip

Change History (17)

by massimo ceraolo, 6 years ago

Attachment: Test.mo added

comment:1 by massimo ceraolo, 6 years ago

Summary: False errorFalse error message?

comment:2 by massimo ceraolo, 6 years ago

Description: modified (diff)

comment:3 by massimo ceraolo, 6 years ago

Description: modified (diff)
Summary: False error message?Wrong error messages

comment:4 by Francesco Casella, 6 years ago

Component: *unknown*OMEdit
Owner: changed from somebody to Adeel Asghar

comment:5 by massimo ceraolo, 6 years ago

Description: modified (diff)

comment:6 by massimo ceraolo, 6 years ago

Description: modified (diff)

comment:7 by Francesco Casella, 6 years ago

Priority: normalblocker

We should try as hard as we can to get rid of these bogus messages in the release version, so I mark this as blocker lest we forget about it.

The new API, which should be pushed in by @adrpo as soon as possible could also help solving the problem.

comment:8 by massimo ceraolo, 6 years ago

Description: modified (diff)

comment:9 by Francesco Casella, 6 years ago

png's should be fixed.

Other messages which are not OMC's fault should be filtered, e.g. all those that contain gtk, etc.

comment:10 by Per Östlund, 6 years ago

I had a look at the pngs for OMEdit, and they were actually fine. There are bad pngs in the MSL, but I get those warnings even when I make OMEdit not load the MSL. So I don't really know where those warnings come from.

But I realised that OMEdit should just ignore libpng warnings anyway, since it has no control over what images it needs to load from userdefined libraries.

comment:11 by Francesco Casella, 6 years ago

Milestone: 1.13.01.14.0

Rescheduled to 1.14.0

comment:12 by massimo ceraolo, 6 years ago

An update regarding point 1).
Now, with

OMEdit 1.14.0~dev-6-ge6e83ea
Connected to OpenModelica 1.14.0~dev-64-g9be2132

under Linux we get a longer warning:

[1] 18:38:39 Scripting Error
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile

[2] 18:38:54 Scripting Error
Invalid type of flag target, expected one of gcc, msvc, msvc10, msvc12, msvc13, msvc15, vxworks69, debugrt but got the string "clang".

Last edited 6 years ago by massimo ceraolo (previous) (diff)

comment:13 by Adeel Asghar, 6 years ago

Cc: Adrian Pop added

4) flange_a falsely reported as missing
If we open Modelica.Mechanics.Translational.Examples.Friction in diagram mode we don't see flanges on stop1 and stop2. If we simulate it we get the following error messages:

[1] 08:53:49 Scripting Error
Unable to find component stop2.flange_a while parsing connection {spring.flange_b,stop2.flange_a,}.
[2] 08:53:49 Scripting Error
Unable to find component stop1.flange_a while parsing connection {force.flange,stop1.flange_a,}.

Nevertheless, the model compiles and runs correctly. Using Dymola we do see flanges on stop1 and stop2, and don't see any error message.

The error messages are indeed correct. The flanges are not displayed and as a result the following connections are missing from the diagram,

connect(spring.flange_b, stop2.flange_a)
    annotation (Line(points={{20,-50},{38,-50}}, color={0,127,0}));
connect(force.flange, stop1.flange_a) annotation (Line(
      points={{0,70},{20,70}}, color={0,127,0}));

The problem is that omc fails to fetch the extends classes of Modelica.Mechanics.Translational.Components.MassWithStopAndFriction. The attached script is a short use case of the problem.

by Adeel Asghar, 6 years ago

Attachment: script.mos added

comment:15 by Adeel Asghar, 6 years ago

Resolution: fixed
Status: newclosed

1) opening message under Linux
message when opening OMEdit under linux (OMEdit 1.13.0~dev-137-g0e9c2ff
Connected to OpenModelica 1.13.0~dev-1195-g6d891ea)
When I open OMEdt I receive the following error message:

[1] 03:46:50 Scripting Error
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile

I don't know what this means and implies. I would say that this massage has no impact on the user's experience: I think it should be either be removed or made clearer for the final user.

After debugging a lot I came to know that these messages are coming from QWebView default images. These images are of course not under our control and we can't fix them. So I added the code to suppress such messages 9fe7631/OMEdit.

2) message when duplicating (tested on Connected to OpenModelica 1.13.0~dev-1195-g6d891ea under Linux, and on OMEdit v1.13.0-dev-113-g8c6364e6 (64-bit)
Connected to v1.13.0-dev-640-gff8188090 (64-bit) under Windows)
Currently OMEdit shows a strange message whenever we duplicate a model in a package.
The issue can be replicated considering the attached Test.mo.
If we duplicate RL1 giving for instance to the duplicated class the name RL2, I receive the following error message:

[1] 21:18:40 Syntax Error
[: 1:0-1:0]: No viable alternative near token: C
[2] 21:18:40 Translation Error
[: 0:0-0:0]: Internal error Failed to scan top of input: EOF
  Expected one of: <EOF>
  Current parse tree is:   The parser stack is:

It seems to me that no error occurred while duplication. So, probably this error message is just wrong

This was indeed and error which is fixed in f0fa107/OMEdit.

3) Opening file under Linux (tested on OMEdit 1.13.0~dev-205-g65f0077
Connected to OpenModelica 1.13.0~dev-1371-gc7f4444)
Open test.mo file using Open Model/Library Files(s) menu command.
The following error message is displayed in red:

[1] 09:03:39 Scripting Error
Gtk-Message: 09:03:35.599: GtkDialog mapped without a transient parent. This is discouraged.

It seems a false error, which is not displayed when loading the same file from the recent Files list.
BTW, I don't understand the meaning of this message, but I would say that something that is just discouraged should be more a warning than an error.

This is another annoying Qt warning. The problem is whenever Qt tries to invoke the native dialogs in Linux this warning comes since Qt passes 0 as parent. The native dialog expects the Gtk object instead of Qt that is why 0 is passed. We can't do much except for suppressing this warning. Done in 9fe7631/OMEdit.

4) flange_a falsely reported as missing
If we open Modelica.Mechanics.Translational.Examples.Friction in diagram mode we don't see flanges on stop1 and stop2. If we simulate it we get the following error messages:

[1] 08:53:49 Scripting Error
Unable to find component stop2.flange_a while parsing connection {spring.flange_b,stop2.flange_a,}.
[2] 08:53:49 Scripting Error
Unable to find component stop1.flange_a while parsing connection {force.flange,stop1.flange_a,}.

Nevertheless, the model compiles and runs correctly. Using Dymola we do see flanges on stop1 and stop2, and don't see any error message.

See comment:14.

5) Opening message under Mac OS
The issue is described in ticket #5122.
As far as I remember also this is a false error since, despite it, OM works normally (cannot check now because currently my Mac installation is broken).

This is also fixed in 9fe7631/OMEdit by filtering this error. This is a Qt bug which is fixed in latest versions but we still use Qt4 on OSX.

Note: See TracTickets for help on using tickets.