Opened 9 years ago

Closed 4 years ago

#3445 closed defect (wontfix)

Compiler segfaults in some cases with +d=failtrace

Reported by: Adrian Pop Owned by: somebody
Priority: high Milestone: never
Component: *unknown* Version: trunk
Keywords: Cc:

Description

With an omc without [6f0b7a70fc84ea54461ad094d3f1fcaf1ef788b5/OMCompiler] applied, compiled with gcc 4.4, run this script via omc +d=failtrace:

loadModel(Modelica);
loadModel(ThermoPower);
checkModel(ThermoPower.PowerPlants.SteamTurbineGroup.Tests.TestST3LRh_bypass); getErrorString();

What you get is this:

adrpo@dev:~/testing$ ~/om/build/bin/omc +d=failtrace t.mos
true
""

Limited backtrace at point of segmentation fault
/home/adrpo/om/build/bin/../lib/x86_64-linux-gnu/omc/libOpenModelicaRuntimeC.so(+0x1ccfe)[0x7f534eb01cfe]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x10340)[0x7f534dec8340]
/home/adrpo/om/build/bin/../lib/x86_64-linux-gnu/omc/libOpenModelicaCompiler.so(omc_Expression_traverseExpBottomUp+0x243)[0x7f534b2b2ff3]
/home/adrpo/om/build/bin/../lib/x86_64-linux-gnu/omc/libOpenModelicaCompiler.so(omc_ExpressionSimplify_simplify1FixP+0x28d)[0x7f534b26d2ad]
/home/adrpo/om/build/bin/../lib/x86_64-linux-gnu/omc/libOpenModelicaCompiler.so(omc_ExpressionSimplify_simplify1WithOptions+0x5d)[0x7f534b26d89d]
/home/adrpo/om/build/bin/../lib/x86_64-linux-gnu/omc/libOpenModelicaCompiler.so(omc_ExpressionSimplify_simplifyWithOptions+0x23f)[0x7f534b274eff]
/home/adrpo/om/build/bin/../lib/x86_64-linux-gnu/omc/libOpenModelicaCompiler.so(omc_ExpressionSimplify_simplify+0x47)[0x7f534b275317]
/home/adrpo/om/build/bin/../lib/x86_64-linux-gnu/omc/libOpenModelicaCompiler.so(omc_ConnectUtil_evaluateConnectionOperators2+0x116)[0x7f534b369246]
/home/adrpo/om/build/bin/../lib/x86_64-linux-gnu/omc/libOpenModelicaCompiler.so(boxptr_ConnectUtil_evaluateConnectionOperators2+0x73)[0x7f534b3692e3]
/home/adrpo/om/build/bin/../lib/x86_64-linux-gnu/omc/libOpenModelicaCompiler.so(+0x1eeb37b)[0x7f534b36937b]
/home/adrpo/om/build/bin/../lib/x86_64-linux-gnu/omc/libOpenModelicaCompiler.so(omc_DAEUtil_traverseDAE2__tail2+0x1396)[0x7f534b321db6]
/home/adrpo/om/build/bin/../lib/x86_64-linux-gnu/omc/libOpenModelicaCompiler.so(omc_DAEUtil_traverseDAE2__tail+0x1b3)[0x7f534b324933]
/home/adrpo/om/build/bin/../lib/x86_64-linux-gnu/omc/libOpenModelicaCompiler.so(omc_DAEUtil_traverseDAE2+0x75)[0x7f534b324a75]
/home/adrpo/om/build/bin/../lib/x86_64-linux-gnu/omc/libOpenModelicaCompiler.so(omc_DAEUtil_traverseDAE+0x136)[0x7f534b325b76]
/home/adrpo/om/build/bin/../lib/x86_64-linux-gnu/omc/libOpenModelicaCompiler.so(omc_ConnectUtil_evaluateConnectionOperators+0x103)[0x7f534b369493]
Segmentation fault (core dumped)

Running gdb on it gets you some pretty
funny stuff, it dies inside a case selection:

(gdb) r +d=failtrace t.mos
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff4331ff3 in omc_Expression_traverseExpBottomUp (threadData=0x7fffffffe1f0, _inExp=0x0,
    _inFunc=0x7ffff53d6783 <boxvar_lit_ExpressionSimplify_simplifyWork+3>,
    _inExtArg=0x7ffff4b78e73 <_OMC_LIT_STRUCT116+3>, out_outExtArg=0x7fffffffa1a8)
    at /home/adrpo/om/OMCompiler/Compiler/boot/build/tmp/Expression.c:32010
32010           case 0: {

Maybe this is an optimization bug in gcc 4.4.0?
We seem to have something to deal with some bugs in MinGW gcc 4.4.0:
https://github.com/OpenModelica/OMCompiler/blob/master/SimulationRuntime/c/meta/meta_modelica.h#L120

Change History (1)

comment:1 by Per Östlund, 4 years ago

Milestone: Futurenever
Resolution: wontfix
Status: newclosed

The model works fine now, and I assume we don't care much about potential bugs in compilers from 2009.

Note: See TracTickets for help on using tickets.