osi-sensor-model-packaging icon indicating copy to clipboard operation
osi-sensor-model-packaging copied to clipboard

Rare memory access issue with SensorViewConfigurationRequest in OSMPDummySensor example

Open ReinhardBiegelIntech opened this issue 1 year ago • 0 comments

Describe the problem

It's a bit hard to trigger, but were able to reproduce this with a custom OSMP sensor based on the OSMPDummySensor example:

  1. FMI/OSMP setup including SensorViewConfigurationRequest
  2. FMI variables are read one-by-one by the simulation environment, so GetInteger is called multiple times.
  3. Code here triggers regeneration of SensorViewConfigurationRequest request for each read
  4. Due to the buffer swapping in 3. (via {refresh,set}_fmi_sensor_view_config_request), the values for SensorViewConfigurationRequest FMI variables (hi, lo and size) might be out of sync. We had the situation that the hi part was different for both buffers, leading to an invalid buffer address being communicated over FMI

Ask your question

  1. Is there a restriction on how OSMP FMI variables have to be read (i.e. do the have to be read by a single call to GetInteger or is it ok to read each one individually)?
  2. Should the need_refresh mechanism be restructured?
  3. Is double-buffering even necessary for the SensorViewConfigurationRequest? According to according to OSMP doc communication of this message is restricted to the initialization mode anyway.

ReinhardBiegelIntech avatar Jul 02 '24 06:07 ReinhardBiegelIntech