Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#5548 closed defect (fixed)

OMEdit crashes during startup

Reported by: Andrea Bartolini Owned by: Adrian Pop
Priority: blocker Milestone: 1.14.0
Component: Interactive Environment Version: v1.14.0-dev-nightly
Keywords: Cc: Francesco Casella

Description

After the update of the nightly build version (update made @08.00 UTC+1 - 26.06.2019) the OMEdit crashes during startup.

Sysop: Linux Ubuntu 16.04

Attachments (6)

errorSplash.png (52.8 KB ) - added by Andrea Bartolini 5 years ago.
omeditcommunication.log (1.0 KB ) - added by Andrea Bartolini 5 years ago.
omeditcommands.mos (391 bytes ) - added by Andrea Bartolini 5 years ago.
openmodelica.stacktrace.OMEdit (613 bytes ) - added by Andrea Bartolini 5 years ago.
omediterror.txt (504 bytes ) - added by Andrea Bartolini 5 years ago.
omeditoutput.txt (93 bytes ) - added by Andrea Bartolini 5 years ago.

Download all attachments as: .zip

Change History (29)

comment:1 by Andrea Bartolini, 5 years ago

Cc: Francesco Casella added

comment:2 by Adeel Asghar, 5 years ago

Can you provide more details. The log files will be helpful.

comment:3 by Andrea Bartolini, 5 years ago

where I can find it?

comment:4 by Andrea Bartolini, 5 years ago

I found this files... if you need others information please give me the path...
thanks

Connected to OpenModelica 1.14.0~dev-26567-g6d621c3
built for Ubuntu 16.04.5 LTS.
The running OS is Ubuntu 16.04.6 LTS on x86_64.

by Andrea Bartolini, 5 years ago

Attachment: errorSplash.png added

by Andrea Bartolini, 5 years ago

Attachment: omeditcommunication.log added

by Andrea Bartolini, 5 years ago

Attachment: omeditcommands.mos added

by Andrea Bartolini, 5 years ago

comment:5 by Adeel Asghar, 5 years ago

That is rather weird that it fails at getAvailableMatchingAlgorithms(). Can you also attach omediterror.txt and omeditoutput.txt?

What happens if you run the following script from command line,

getVersion();
getErrorString();
getAvailableMatchingAlgorithms();
getErrorString();

comment:6 by Andrea Bartolini, 5 years ago

running the script from command line I get this error:

andrea@andrea-hp-pavilion-notebook:~/Desktop$ omc test.mos
"OpenModelica 1.14.0~dev-26567-g6d621c3"
""

Limited backtrace at point of segmentation fault
/lib/x86_64-linux-gnu/libc.so.6(+0x354b0)[0x7f1d3e5d44b0]
/usr/bin/../lib/x86_64-linux-gnu/omc/libOpenModelicaCompiler.so(omc_ValuesUtil_valueExp+0x9a)[0x7f1d3f7a77e9]
/usr/bin/../lib/x86_64-linux-gnu/omc/libOpenModelicaCompiler.so(omc_Ceval_cevalIfConstant+0x2f6)[0x7f1d3f9de634]
/usr/bin/../lib/x86_64-linux-gnu/omc/libOpenModelicaCompiler.so(omc_Static_elabCallArgs3+0x69a)[0x7f1d3f80d4b4]
/usr/bin/../lib/x86_64-linux-gnu/omc/libOpenModelicaCompiler.so(omc_Static_elabCallArgs2+0xded)[0x7f1d3f80e38d]
/usr/bin/../lib/x86_64-linux-gnu/omc/libOpenModelicaCompiler.so(omc_Static_elabCallArgs+0xac)[0x7f1d3f80f58d]
/usr/bin/../lib/x86_64-linux-gnu/omc/libOpenModelicaCompiler.so(omc_Static_elabCall+0x5d7)[0x7f1d3f8119a7]
/usr/bin/../lib/x86_64-linux-gnu/omc/libOpenModelicaCompiler.so(omc_Static_elabExpCall+0xf3)[0x7f1d3f831012]
/usr/bin/../lib/x86_64-linux-gnu/omc/libOpenModelicaCompiler.so(omc_Static_elabExp+0x32e)[0x7f1d3f827fd6]
/usr/bin/../lib/x86_64-linux-gnu/omc/libOpenModelicaCompiler.so(omc_StaticScript_elabCallInteractive
work+0xaf7)[0x7f1d3f715534]
/usr/bin/../lib/x86_64-linux-gnu/omc/libOpenModelicaCompiler.so(omc_StaticScript_elabCall+0xb7)[0x7f1d3f714a05]
/usr/bin/../lib/x86_64-linux-gnu/omc/libOpenModelicaCompiler.so(omc_StaticScript_elabExp2+0x245)[0x7f1d3f716d64]
/usr/bin/../lib/x86_64-linux-gnu/omc/libOpenModelicaCompiler.so(omc_StaticScript_elabExp+0x8a)[0x7f1d3f716e98]
/usr/bin/../lib/x86_64-linux-gnu/omc/libOpenModelicaCompiler.so(omc_Interactive_evaluateExpr+0x112)[0x7f1d3f761bea]
/usr/bin/../lib/x86_64-linux-gnu/omc/libOpenModelicaCompiler.so(omc_Interactive_evaluateExprToStr+0xac)[0x7f1d3f761ab7]
Segmentation fault

by Andrea Bartolini, 5 years ago

Attachment: omediterror.txt added

by Andrea Bartolini, 5 years ago

Attachment: omeditoutput.txt added

comment:7 by Adeel Asghar, 5 years ago

Component: OMEditInteractive Environment
Owner: changed from Adeel Asghar to Adrian Pop
Status: newassigned

comment:8 by Andrea Bartolini, 5 years ago

Tnks Adeel for the prompt reply

comment:9 by Adrian Pop, 5 years ago

This is very strange, I have no idea why this happens. I will try to install it myself on a Ubuntu 16.04 and see if I can reproduce this issue.

comment:10 by Adrian Pop, 5 years ago

Ok. I can reproduce this bug on a Ubuntu 16.04 system. I will investigate more.

comment:11 by Francesco Casella, 5 years ago

@adrpo, the previous Ubuntu nightly build worked, so the root cause is in some commit of 25 June. Too bad there are eight of them, but with some luck you should be able to single that out.

Last edited 5 years ago by Francesco Casella (previous) (diff)

comment:12 by Adrian Pop, 5 years ago

@casella: I have looked at this yesterday for a couple of hours, I don't think is any of these commits that generated the issue. This doesn't happen on any other Linux distro, it works fine in Ubuntu 18.04. It also works fine if I compile omc with -g but not if I compile it with -g -O2. Seems to be an issue with one of the optimizations in clang. For gcc we do have some of the optimizations disabled for some gcc versions. Seems to be the same for clang now. The place where it crashes is weird:

      for (; tmp3 < 23; tmp3++) {
        switch (MMC_SWITCH_CAST(tmp3)) {
        case 0: {
          modelica_integer tmp5; // <-- it dies on this line!?!
          if (mmc__uniontype__metarecord__typedef__equal(tmp3_1,0,1) == 0) goto tmp2_end;

comment:13 by Andrea Bartolini, 5 years ago

does this compiler optimization added to the last nightly build?
The previous nightly build worked fine on my Ubuntu 16.04.

If there are no other way to solve the issue, we can do without compiler optimization which generates the problem ...

comment:14 by Adrian Pop, 5 years ago

I just compiled again the last commit from 24 June: 3d2537/OpenModelica and strangely it works fine. I will check which of the commits from 25 June is to blame (it can be only one or two as the other ones are for OMEdit).

comment:15 by Adrian Pop, 5 years ago

The commit to blame is 08ed260/OpenModelica which has *absolutely* no relation with the compiler build or to where the omc actually dies!?!
This is VERY weird. I will see if I can find out more.

comment:16 by Adeel Asghar, 5 years ago

Ok that is totally crazy since that commit is not reverted so it should cause a crash in today's version as well.

comment:17 by Adrian Pop, 5 years ago

I think CevalScriptBackend.cevalInteractiveFunctions3 became to big and somehow clang just fails to compile it properly anymore. I now split it in two with PR: https://github.com/OpenModelica/OpenModelica/pull/288
Testing this works on Ubuntu 16.04. I will merge it, and then start the Linux nightly-builds.

comment:18 by Adrian Pop, 5 years ago

The PR is now merged, we will see tomorrow how the nightly works.

comment:19 by Francesco Casella, 5 years ago

This is all quite creepy :)

comment:20 by Adrian Pop, 5 years ago

Not really, we had similar things before when one of the functions grew too big (the C compiler failed to compile it or generated bad code). The function had 272 cases, i now split it in two.

comment:21 by Francesco Casella, 5 years ago

I mean, a compiler which fails to compile is ok, but a compiler that generates bad code without complaining reall isn't

comment:22 by Andrea Bartolini, 5 years ago

Resolution: fixed
Status: assignedclosed

The new Nightly build works fine on my Ububtu 16.04 :)
Thanks to all for the effort and the quick solution!

@Casella
Really it is not creepy, it sometimes happens when you require high optimization to the compiler.

comment:23 by Adrian Pop, 5 years ago

See also #5553.

Note: See TracTickets for help on using tickets.