Skip to content

[FMI 2.0 Cosimulation] BouncingBall FMU crashes when importing a serialized state that was generated in a different process #635

@davidhjp01

Description

@davidhjp01

Hi,
I am currently testing FMI 2.0 state serialization API (fmi2SerializeFMUstate and fmi2DeSerializeFMUstate) using the BouncingBall example. And I wrote a small program for testing this.

It seems the FMU can import a serialized state correctly when both serialization/deserialization take place within "the same program run" (process). But, when I try to export/import a state in two different processes in sequence, (i.e. first run to dump the state into a file, and import it in a second run), FMU crashes.

After some investigation, it seems in cosiumlatiion.c Status setFMUState(ModelInstance*, void*), memcpying s->x (or also dereferncing s->x)
causes this crash.

Image

Also seeing the same behaviour with fmpy:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions