﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
2980	String GC issues	Per Östlund	somebody	"It seems we have some kind of garbage collection issue with strings. For example with this model:
{{{#!mo
model M
  String str[:] = Modelica.Utilities.Streams.readFile(""M.mo""); // Reads itself
algorithm
  for i in 1:1000 loop
    print(String(i) + ""\n"");
    for j in 1:size(str, 1) loop
      print(str[j] + ""\n"");
    end for;
  end for;
end M;
}}}
Compiling this with +d=noevalfunc so the readFile isn't constant evaluated, this model segfaults in stringAppend every time I run it. It prints itself out ~990 times or so (it's slightly different each execution), and then it starts to drop some of the newlines until it finally segfaults a few iterations later.

Running the model with GC_DONT_GC=1 works perfectly fine, so it seems to be some kind of GC issue. I also tried it with an older revision than r23321 (before the change to MetaModelica strings), and the only difference was that it started printing garbage after a while instead of segfaulting. Turning off the GC solved the issue in that case also.

This is the last remaining issue with the wind power model I'm trying to get running."	defect	closed	critical	1.9.4	Run-time	trunk	fixed		Martin Sjölund Adrian Pop
