Opened 8 years ago

Closed 8 years ago

#4028 closed defect (fixed)

Stack overflow for function call

Reported by: Vitalij Ruge Owned by: somebody
Priority: normal Milestone: Future
Component: *unknown* Version:
Keywords: Cc:

Description

I get for the following example:

  function f
     input Real[:,:,:] x;
     output Real y;
  algorithm
     y := sum(x[:,:,1]);
  end f;
  Real x = f(p);
  constant Integer N = 5;
  constant Real [N, N, N] p = {{{ (if k == 1 then 1 else 0)
                        for i in 1:N}
                        for j in 1:N}
                        for k in 1:N};
end foo;
OM/OMCompiler/Compiler/Script/CevalScript.mo:2329:257-2329:276:writable] Error: Internal error Stack overflow when evaluating function call: foo.f({{{1.0, 1.0, 1.0, 1.0, 1.0}, {1.0, 1.0, 1.0, 1.0, 1.0}, {1.0, 1.0, 1.0, 1.0, 1.0}, {1.0, 1.0, 1.0, 1.0, 1.0}, {1.0, 1.0, 1.0, 1.0, 1.0}}, {{0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, {{0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, {{0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}, {{0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0}}})...
[bt] #1 /home//OM/build/bin/../lib/x86_64-linux-gnu/omc/libOpenModelicaRuntimeC.so(mmc_setStacktraceMessages_threadData)
[bt] #2...1024 /home//OM/build/bin/../lib/x86_64-linux-gnu/omc/libOpenModelicaCompiler.so(ValuesUtil.sumArrayelt)
[bt] #1025 [...]

Change History (1)

comment:1 by Per Östlund, 8 years ago

Resolution: fixed
Status: newclosed

Fixed in dbbcff9.

Note: See TracTickets for help on using tickets.