You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that all FMUs generated with pythonfmu exhibit a similar memory error. For example, using Resistor.fmu on Ubuntu 20.04 with Python3.12, the memory error can be observed as follows:
==10839== Invalid read of size 4
==10839== at 0x1C479932: finalizePythonInterpreter (in /tmp/tmpmz0zx7v4/binaries/linux64/Resistor.so)
==10839== by 0x4011F6A: _dl_fini (dl-fini.c:138)
==10839== by 0x4F7F8A6: __run_exit_handlers (exit.c:108)
==10839== by 0x4F7FA5F: exit (exit.c:139)
==10839== by 0x4F5D089: (below main) (libc-start.c:342)
==10839== Address 0x6a84a18 is 8 bytes inside a block of size 128 free'd
==10839== at 0x483CFBF: operator delete(void*) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==10839== by 0x4F7F8A6: __run_exit_handlers (exit.c:108)
==10839== by 0x4F7FA5F: exit (exit.c:139)
==10839== by 0x4F5D089: (below main) (libc-start.c:342)
==10839== Block was alloc'd at
==10839== at 0x483BE63: operator new(unsigned long) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==10839== by 0x1C47ED79: CppfmuInstantiateSlave(char const*, char const*, char const*, char const*, double, int, int, cppfmu::Memory, cppfmu::Logger const&) (in /tmp/tmpmz0zx7v4/binaries/linux64/Resistor.so)
==10839== by 0x1C47620F: fmi2Instantiate (in /tmp/tmpmz0zx7v4/binaries/linux64/Resistor.so)
==10839== by 0x4F31FF4: ??? (in /usr/lib/x86_64-linux-gnu/libffi.so.7.1.0)
==10839== by 0x4F31409: ??? (in /usr/lib/x86_64-linux-gnu/libffi.so.7.1.0)
==10839== by 0x5E32BA6: _call_function_pointer (callproc.c:931)
==10839== by 0x5E32BA6: _ctypes_callproc (callproc.c:1273)
==10839== by 0x5E318EB: PyCFuncPtr_call (_ctypes.c:4173)
==10839== by 0x4A7165D: PyObject_Call (object.h:705)
==10839== by 0x4ADFAC1: _PyEval_EvalFrameDefault (bytecodes.c:3263)
==10839== by 0x4B7CEE5: PyEval_EvalCode (ceval.c:578)
==10839== by 0x4B9E8B0: run_eval_code_obj (pythonrun.c:1722)
==10839== by 0x4B9E82A: run_mod (pythonrun.c:1743)
The text was updated successfully, but these errors were encountered:
dddvision
changed the title
Memory leak in generated FMUs
Memory error in generated FMUs
Feb 28, 2025
It seems that all FMUs generated with pythonfmu exhibit a similar memory error. For example, using Resistor.fmu on Ubuntu 20.04 with Python3.12, the memory error can be observed as follows:
Create Resistor_memory_error.py:
Run valgrind:
Observe result in fmu_memory_use.log:
The text was updated successfully, but these errors were encountered: