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

OMSimulator crashes when FMU sends a log message without a category #1323

Open
rruusu opened this issue Oct 30, 2024 · 2 comments
Open

OMSimulator crashes when FMU sends a log message without a category #1323

rruusu opened this issue Oct 30, 2024 · 2 comments

Comments

@rruusu
Copy link

rruusu commented Oct 30, 2024

Description

The FMI standard allows an FMU to call the logging function with a null pointer for the category, if it doesn't defined any categories.

When this happens, OMSimulator crashes, as it does not check for a null value in the category argument in its logging function.

When executed using the command line omsimulator executable, the crash is silent and produces no related console prints.

Steps to reproduce

  1. Simulate an SSP containing FMUs producing messages with category NULL.
  2. OMSimulator crashes silently, retuning a seemingly random exit status

Example:

C:\...>omsimulator Demo_ss3.ssp --logLevel=1 || echo Error: %errorlevel%
...
Error: -1073741819

Version and OS

  • Version: OMSimulator v2.1.2-mingw-notlm-debug
  • OS: Windows 11, 64-bit
@rruusu
Copy link
Author

rruusu commented Oct 30, 2024

The culprit is function void oms::fmi2logger(fmi2ComponentEnvironment env, fmi2String instanceName, fmi2Status status, fmi2String category, fmi2String message, ...) in Component.cpp.

@arun3688
Copy link
Contributor

arun3688 commented Oct 30, 2024

@rruusu It would be good if you can attach your ssp or Fmu's which can reproduce the issue, if you cannot share your model or ssp make a small fmu which can reproduce the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants