osi-sensor-model-packaging
osi-sensor-model-packaging copied to clipboard
Rare memory access issue with SensorViewConfigurationRequest in OSMPDummySensor example
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:
- FMI/OSMP setup including
SensorViewConfigurationRequest - FMI variables are read one-by-one by the simulation environment, so
GetIntegeris called multiple times. - Code here triggers regeneration of
SensorViewConfigurationRequestrequest for each read - 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
- 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
GetIntegeror is it ok to read each one individually)? - Should the
need_refreshmechanism be restructured? - 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.