#3801 closed defect (fixed)
Tests with GCC are broken since 21 March
Reported by: | Adrian Pop | Owned by: | Adrian Pop |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | Backend | Version: | |
Keywords: | Cc: | Vitalij Ruge, Willi Braun |
Description
Since 1d83ca90cb1496acb61a86152472adbac8d06f2e/OpenModelica the test ran with omc compiled with GCC are broken.
Change History (8)
comment:1 by , 9 years ago
Cc: | added |
---|
comment:2 by , 9 years ago
Better error from valgrind with -g:
==2431== Memcheck, a memory error detector ==2431== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al. ==2431== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info ==2431== Command: /home/adrpo/om/build/bin/omc Bug1728.mos ==2431== ==2431== Conditional jump or move depends on uninitialised value(s) ==2431== at 0x57F356F: omc_ExpressionSolve_solveSimpleEquations (ExpressionSolve.mo:96) ==2431== by 0x58A2CC1: omc_BackendDAEUtil_postOptimizeDAE (BackendDAEUtil.mo:6982) ==2431== by 0x575EA05: omc_Initialization_solveInitialSystem (Initialization.mo:203) ==2431== by 0x58A3149: omc_BackendDAEUtil_getSolvedSystem (BackendDAEUtil.mo:6642) ==2431== by 0x55E42BB: omc_SimCodeMain_translateModel (SimCodeMain.mo:693) ==2431== by 0x5600287: omc_CevalScriptBackend_translateModel (CevalScriptBackend.mo:2677) ==2431== by 0x5600CCA: omc_CevalScriptBackend_buildModel (CevalScriptBackend.mo:4331) ==2431== by 0x5616BB4: omc_CevalScriptBackend_cevalInteractiveFunctions3 (CevalScriptBackend.mo:1182) ==2431== by 0x5A96314: omc_CevalScript_cevalInteractiveFunctions2 (CevalScript.mo:1654) ==2431== by 0x5A97305: omc_CevalScript_cevalInteractiveFunctions (CevalScript.mo:514) ==2431== by 0x5A98693: omc_CevalScript_ceval (CevalScript.mo:168) ==2431== by 0x5A73430: omc_Interactive_evaluateExpr (Interactive.mo:788) ==2431== ==2431== Invalid read of size 4 ==2431== at 0x5DBA2C4: mmc_mk_scon (modelica_string.h:105) ==2431== by 0x5DBA2C4: System_strtokIncludingDelimiters (System_omc.c:921) ==2431== by 0x594C56C: omc_Tpl_writeStr (Tpl.mo:135) ==2431== by 0x5998F7F: omc_CodegenUtil_lm__65 (CodegenUtil.mo:1453) ==2431== by 0x599AD28: omc_CodegenUtil_fun__77 (CodegenUtil.mo:1893) ==2431== by 0x599B172: omc_CodegenUtil_lm__78 (CodegenUtil.mo:2105) ==2431== by 0x55210BC: omc_CodegenC_fun__559 (CodegenC.mo:24065) ==2431== by 0x5536105: omc_CodegenC_fun__560 (CodegenC.mo:24164) ==2431== by 0x5536202: omc_CodegenC_equation__ (CodegenC.mo:24182) ==2431== by 0x5534CC6: omc_CodegenC_functionExtraResidualsPreBody (CodegenC.mo:12065) ==2431== by 0x553B02D: omc_CodegenC_lm__297 (CodegenC.mo:12314) ==2431== by 0x553BA1C: omc_CodegenC_fun__324 (CodegenC.mo:13336) ==2431== by 0x553BE45: omc_CodegenC_lm__325 (CodegenC.mo:13581) ==2431== Address 0x106a8110 is 0 bytes inside a block of size 2 alloc'd ==2431== at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==2431== by 0x5DBA2A8: System_strtokIncludingDelimiters (System_omc.c:918) ==2431== by 0x594C56C: omc_Tpl_writeStr (Tpl.mo:135) ==2431== by 0x5998F7F: omc_CodegenUtil_lm__65 (CodegenUtil.mo:1453) ==2431== by 0x599AD28: omc_CodegenUtil_fun__77 (CodegenUtil.mo:1893) ==2431== by 0x599B172: omc_CodegenUtil_lm__78 (CodegenUtil.mo:2105) ==2431== by 0x55210BC: omc_CodegenC_fun__559 (CodegenC.mo:24065) ==2431== by 0x5536105: omc_CodegenC_fun__560 (CodegenC.mo:24164) ==2431== by 0x5536202: omc_CodegenC_equation__ (CodegenC.mo:24182) ==2431== by 0x5534CC6: omc_CodegenC_functionExtraResidualsPreBody (CodegenC.mo:12065) ==2431== by 0x553B02D: omc_CodegenC_lm__297 (CodegenC.mo:12314) ==2431== by 0x553BA1C: omc_CodegenC_fun__324 (CodegenC.mo:13336) ==2431== ==2431== Invalid read of size 4 ==2431== at 0x5DBA2DA: mmc_mk_scon (modelica_string.h:105) ==2431== by 0x5DBA2DA: System_strtokIncludingDelimiters (System_omc.c:921) ==2431== by 0x594C56C: omc_Tpl_writeStr (Tpl.mo:135) ==2431== by 0x5998F7F: omc_CodegenUtil_lm__65 (CodegenUtil.mo:1453) ==2431== by 0x599AD28: omc_CodegenUtil_fun__77 (CodegenUtil.mo:1893) ==2431== by 0x599B172: omc_CodegenUtil_lm__78 (CodegenUtil.mo:2105) ==2431== by 0x55210BC: omc_CodegenC_fun__559 (CodegenC.mo:24065) ==2431== by 0x5536105: omc_CodegenC_fun__560 (CodegenC.mo:24164) ==2431== by 0x5536202: omc_CodegenC_equation__ (CodegenC.mo:24182) ==2431== by 0x5534CC6: omc_CodegenC_functionExtraResidualsPreBody (CodegenC.mo:12065) ==2431== by 0x553B02D: omc_CodegenC_lm__297 (CodegenC.mo:12314) ==2431== by 0x553BA1C: omc_CodegenC_fun__324 (CodegenC.mo:13336) ==2431== by 0x553BE45: omc_CodegenC_lm__325 (CodegenC.mo:13581) ==2431== Address 0x106a8b28 is 40 bytes inside a block of size 43 alloc'd ==2431== at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==2431== by 0x5DBA2A8: System_strtokIncludingDelimiters (System_omc.c:918) ==2431== by 0x594C56C: omc_Tpl_writeStr (Tpl.mo:135) ==2431== by 0x5998F7F: omc_CodegenUtil_lm__65 (CodegenUtil.mo:1453) ==2431== by 0x599AD28: omc_CodegenUtil_fun__77 (CodegenUtil.mo:1893) ==2431== by 0x599B172: omc_CodegenUtil_lm__78 (CodegenUtil.mo:2105) ==2431== by 0x55210BC: omc_CodegenC_fun__559 (CodegenC.mo:24065) ==2431== by 0x5536105: omc_CodegenC_fun__560 (CodegenC.mo:24164) ==2431== by 0x5536202: omc_CodegenC_equation__ (CodegenC.mo:24182) ==2431== by 0x5534CC6: omc_CodegenC_functionExtraResidualsPreBody (CodegenC.mo:12065) ==2431== by 0x553B02D: omc_CodegenC_lm__297 (CodegenC.mo:12314) ==2431== by 0x553BA1C: omc_CodegenC_fun__324 (CodegenC.mo:13336) ==2431== true "" record SimulationResult resultFile = "/home/adrpo/om/testsuite/simulation/modelica/others/Bug1728_res.mat", simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'Bug1728', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''", messages = "", timeFrontend = 1.134219764, timeBackend = 1.348700416, timeSimCode = 1.390526046, timeTemplates = 0.908887247, timeCompile = 0.872655063, timeSimulation = 0.029520018, timeTotal = 5.709446217 end SimulationResult; "Warning: The initial conditions are not fully specified. Use +d=initialization for more information. Warning: There are iteration variables with default zero start attribute. Use +d=initialization for more information. " {2.0,1.0,1.0} {0.0,40.66,41.1} ==2431== ==2431== HEAP SUMMARY: ==2431== in use at exit: 120,702 bytes in 86 blocks ==2431== total heap usage: 22,992 allocs, 22,906 frees, 56,570,125 bytes allocated ==2431== ==2431== LEAK SUMMARY: ==2431== definitely lost: 8,456 bytes in 4 blocks ==2431== indirectly lost: 0 bytes in 0 blocks ==2431== possibly lost: 3,811 bytes in 13 blocks ==2431== still reachable: 108,435 bytes in 69 blocks ==2431== suppressed: 0 bytes in 0 blocks ==2431== Rerun with --leak-check=full to see details of leaked memory ==2431== ==2431== For counts of detected and suppressed errors, rerun with: -v ==2431== Use --track-origins=yes to see where uninitialised values come from ==2431== ERROR SUMMARY: 59 errors from 3 contexts (suppressed: 31323 from 80)
follow-up: 5 comment:3 by , 9 years ago
Attempted to fix it with c81d1df4/OMCompiler but it seems is not what is intended.
What should ExprssionSolve.solveSimpleEquationsWork return for "solved" output variable here?
if not (Types.isIntegerOrRealOrSubTypeOfEither(Expression.typeof(e1)) and Types.isIntegerOrRealOrSubTypeOfEither(Expression.typeof(e2))) then return; end if;
When I set solved := false;
it doesn't work with CLANG also.
follow-up: 6 comment:4 by , 9 years ago
Fixed in 5e8c11b1932d7bbf72019fc19f62ce4c8a319d7e/OMCompiler.
I'll leave this open so that vitalij or wbraun can check if is correct.
comment:5 by , 9 years ago
Replying to adrpo:
Attempted to fix it with c81d1df4/OMCompiler but it seems is not what is intended.
What should ExprssionSolve.solveSimpleEquationsWork return for "solved" output variable here?
if not (Types.isIntegerOrRealOrSubTypeOfEither(Expression.typeof(e1)) and Types.isIntegerOrRealOrSubTypeOfEither(Expression.typeof(e2))) then return; end if;When I set
solved := false;
it doesn't work with CLANG also.
That wired. I think solved := false;
should be correct,
but let's wait for vitalijs opinion.
comment:6 by , 9 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
Replying to adrpo:
Fixed in 5e8c11b1932d7bbf72019fc19f62ce4c8a319d7e/OMCompiler.
I'll leave this open so that vitalij or wbraun can check if is correct.
Thanks :)
seem fine for me.
comment:7 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Running valgrind on it gets you:
The issues seems to be in omc_ExpressionSolve_solveSimpleEquations. I'll run it on an omc compiled with -g to get more info.