Opened 7 years ago

Last modified 7 years ago

#4533 assigned defect

FMIL cannot delete Cpp FMUs binaries

Reported by: Lennart Ochel Owned by: Lennart Ochel
Priority: high Milestone: Future
Component: FMI Version:
Keywords: Cc:

Description

I have no clue why, but the FMILibrary cannot remove the binaries for Cpp FMUs after freeing all resources. The strange thing is, that is works totally fine using the c runtime.
I get the following error message using OMFMISimulator for any FMU using Cpp runtime:

rm: cannot remove ‘temp_O3Lzyk/binaries/linux64/me_A_cpp.so’: Input/output error
error:   module JMPRT: Error removing temp_O3Lzyk (Invalid argument)

Change History (3)

comment:1 by Rüdiger Franke, 7 years ago

Owner: changed from Rüdiger Franke to Lennart Ochel
Status: newassigned

Removal of FMUs is done regularily by HQP. It even dlcloses and removes an old version, followed by unzip and dlopen of a new version on the fly. This is why the problem cannot be related to Cpp FMUs.

In case you want to try, follow the instructions in section 5.2 Reproduction of Results:
https://www.modelica.org/events/modelica2015/proceedings/html/submissions/ecp15118339_FrankeWaltherWorschechBraunBachmann.pdf

You may touch the FMU during time {source drumboiler.tcl} nRun -- this will delete the old version and unzip the new version for the next run.

comment:2 by Martin Sjölund, 7 years ago

Seems FMIL still doesn't use RTLD_DEEPBIND, which can cause errors if you have the same symbols in the simulator as in the FMU, but it at least avoids RTLD_NODELETE so it should clean up its state on dlclose. Running OMSimulator, I don't see dlclose being called.

comment:3 by Martin Sjölund, 7 years ago

From tracing the simulator, CompositeModel::terminate() calls terminate on the FMUWrapper instances, but does not call the destructor and does thus not call dlclose... Adding oms_unload in main.cpp works fine with Cpp FMUs for me and it then removes the temp-directory.

Note: See TracTickets for help on using tickets.