Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak on fatal error #1

Open
kyllingstad opened this issue May 15, 2018 · 0 comments
Open

Memory leak on fatal error #1

kyllingstad opened this issue May 15, 2018 · 0 comments
Labels
bug conformance FMI conformance issue

Comments

@kyllingstad
Copy link
Member

FMI specifies that when fmiFatal is returned from a function, "the slave is irreparably corrupted. [...] It is not possible to call any other function of the slave." (FMI for Co-simulation 1.0, Sec 3.1.2; emphasis mine. FMI 2.0 has a similar phrasing.).

In other words, after a function has returned fmiFatal, fmiFreeInstance() will never be called, which for CPPFMU means we have a memory leak.

In C++, destructors should always be safe to run, so I think the correct solution is to call fmiFreeInstance() from all FatalError handlers.

@kyllingstad kyllingstad added bug conformance FMI conformance issue labels May 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug conformance FMI conformance issue
Projects
None yet
Development

No branches or pull requests

1 participant