﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
5102	FMU Memory Issue (Segfault when simulating)	anonymous	Lennart Ochel	"Likely related to #4135

I am doing a parameter estimation on an FMU generated by OM. This parameter estimation is performed by PyFMI (Original Issue Logged with PyFMI: https://github.com/modelon/PyFMI/issues/7). If I run a large enough estimation (long simulation duration or numerous params to be simulated), I will encounter a segfault.

The PyFMI dev suspects it's a memory issue with the generated FMU.

I can't get the FMU Compliance Checker to trigger a segfault.

I ran the PyFMI script inside gdb and printed out a backtrace of the fault :
{{{
Program received signal SIGSEGV, Segmentation fault.
0x00007fffd862fbdf in pool_malloc.lto_priv ()
   from /tmp/luke/JModelica.org/jm_tmpjW_YQw/binaries/linux64/Test.so
(gdb) Quit
(gdb) bt
#0  0x00007fffd862fbdf in pool_malloc.lto_priv ()
   from /tmp/luke/JModelica.org/jm_tmpjW_YQw/binaries/linux64/Test.so
#1  0x00007fffd86422b2 in mmc_mk_scon.lto_priv ()
   from /tmp/luke/JModelica.org/jm_tmpjW_YQw/binaries/linux64/Test.so
#2  0x00007fffd8631167 in modelica_string_format_to_c_string_format ()
   from /tmp/luke/JModelica.org/jm_tmpjW_YQw/binaries/linux64/Test.so
#3  0x00007fffd8631180 in modelica_real_to_modelica_string_format ()
   from /tmp/luke/JModelica.org/jm_tmpjW_YQw/binaries/linux64/Test.so
#4  0x00007fffd863cdcd in Test_eqFunction_49 ()
   from /tmp/luke/JModelica.org/jm_tmpjW_YQw/binaries/linux64/Test.so
#5  0x00007fffd863d2c2 in Test_updateBoundParameters ()
   from /tmp/luke/JModelica.org/jm_tmpjW_YQw/binaries/linux64/Test.so
#6  0x00007fffd86461ae in initialization ()
   from /tmp/luke/JModelica.org/jm_tmpjW_YQw/binaries/linux64/Test.so
#7  0x00007fffd863eace in fmi2EnterInitializationMode ()
   from /tmp/luke/JModelica.org/jm_tmpjW_YQw/binaries/linux64/Test.so
#8  0x00007fffe4122b4e in __pyx_pf_5pyfmi_3fmi_13FMUModelBase2_34enter_initialization_mode (__pyx_v_self=0x5555570b8300) at src/pyfmi/fmi.c:46575
#9  __pyx_pw_5pyfmi_3fmi_13FMUModelBase2_35enter_initialization_mode (
    __pyx_v_self=0x5555570b8300, unused=<optimised out>)
    at src/pyfmi/fmi.c:46512
#10 0x00007fffe4067a30 in __Pyx_PyObject_CallMethO (arg=0x0, 
    func=0x7fffd3f047a0) at src/pyfmi/fmi.c:96058
}}}"	defect	closed	high	Future	FMI	v1.12.0	fixed		
