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: Adrian Pop Owned by: Adrian Pop
Priority: high Milestone:
Component: FMI Version:
Keywords: Cc: Andreas Heuermann, Martin Sjölund

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 by Adrian Pop, 4 years ago

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 by Adrian Pop, 4 years ago

Owner: changed from Lennart Ochel to Adrian Pop
Status: newaccepted

comment:3 by Andreas Heuermann, 4 years ago

Cc: Andreas Heuermann Martin Sjölund 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 by Francesco Casella, 4 years ago

Thanks @adrpo, this was a bad one.

comment:5 by Francesco Casella, 4 years ago

Milestone: 1.17.01.18.0

Retargeted to 1.18.0 because of 1.17.0 timed release.

comment:6 by Francesco Casella, 3 years ago

Milestone: 1.18.0

Ticket retargeted after milestone closed

Note: See TracTickets for help on using tickets.