Opened 13 years ago
Closed 13 years ago
#1775 closed defect (fixed)
Concatenating a string with an unbound string variable segfaults
| Reported by: | Owned by: | Martin Sjölund | |
|---|---|---|---|
| Priority: | high | Milestone: | 1.9.0 |
| Component: | Backend | Version: | |
| Keywords: | Cc: |
Description
package StringAppend function test input String s; output String s2; algorithm // Causes a segfault. s2 := s +& s2; end test; end StringAppend;
script file:
setCommandLineOptions({"+d=rml,noevalfunc,failtrace","+g=MetaModelica","+showAnnotations","+showErrorMessages"});
loadFile("StringAppend.mo"); getErrorString();
StringAppend.test("X"); getErrorString();
// Expected
// Something along the line of "Cannot read from unbound output variable".
// Actual:
// Segmentation fault: 11
// endResult
Change History (3)
comment:1 by , 13 years ago
comment:2 by , 13 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
comment:3 by , 13 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.

It does in C as well :)
Results are undefined according to Modelica semantics, so the segfault is "fine". Making a null-pointer check here costs too much time at run-time. Checks for unbound variables are planned for later.