Opened 4 years ago

Last modified 3 years ago

#6161 accepted defect

[FMI] FMU with string parameters will crash if a memory pool collection happens

Reported by: adrpo Owned by: adrpo
Priority: high Milestone:
Component: FMI Version:
Keywords: Cc: AnHeuermann, sjoelund.se

Description

The memory pool frees the string parameters which it shouldn't do.
We need a way to alloc and save the string parameters so that we can free them properly, but only when the FMU is terminated.

Change History (6)

comment:1 Changed 4 years ago by adrpo

For now I will fix this by allocating string parameters using mmc_mk_scon_persist, we should fix this properly later. We need to save and free these on per FMU instance basis.

comment:2 Changed 4 years ago by adrpo

  • Owner changed from lochel to adrpo
  • Status changed from new to accepted

comment:3 Changed 4 years ago by AnHeuermann

  • Cc AnHeuermann sjoelund.se added

We could generate the matching free call to '<%str%> = mmc_mk_scon_persist(<%initVal(v)%>); and evaluate it when fmi2FreeInstance is called.

Also we need to free strings before assigning new values to them.

Maybe we need to change the memory handling for strings even more.

comment:4 Changed 4 years ago by casella

Thanks @adrpo, this was a bad one.

comment:5 Changed 3 years ago by casella

  • Milestone changed from 1.17.0 to 1.18.0

Retargeted to 1.18.0 because of 1.17.0 timed release.

comment:6 Changed 3 years ago by casella

  • Milestone 1.18.0 deleted

Ticket retargeted after milestone closed

Note: See TracTickets for help on using tickets.