open-simulation-interface icon indicating copy to clipboard operation
open-simulation-interface copied to clipboard

Problems with dynamic linking

Open clemenshabedank opened this issue 4 years ago • 4 comments

Describe the feature

The OSI library must offer the possibility that within a C++ program (one process) two or more different OSI versions can be used simultaneously as dynamic libraries (shared libraries). This is not possible due to the "Custom Options" [1] in the current OSI version 3.X.X with the used FileOption (see [2]). and leads to the following runtime error:

[libprotobuf FATAL external/com_google_protobuf/src/google/protobuf/extension_set.cc:93] Multiple extension registrations for type "google.protobuf.FileOptions", field number 81000.
unknown file: Failure
C++ exception with description "Multiple extension registrations for type "google.protobuf.FileOptions", field number 81000." thrown in the test body.

[1] https://developers.google.com/protocol-buffers/docs/proto#customoptions [2] https://github.com/OpenSimulationInterface/open-simulation-interface/blob/6ae62d627fc10f40b6cb567989b94caab6502751/osi_version.proto.in#L54

Important note: As discussed a reminder for the v4.0 release (not backward compatible). This issue is uploaded by me on behalf of BMW.

@pmai @ThomasNaderBMW FYI

clemenshabedank avatar Oct 20 '21 10:10 clemenshabedank

We at openPASS are also interested in having this problem solved :-)

Is there a fix planned for v4.0.0 or is it still in discussion?

ReinhardBiegelIntech avatar Nov 16 '21 13:11 ReinhardBiegelIntech

I did some tests and found the "Multiple extension registrations" error to disappear, if I just don't access the extension. So if I don't use this code (or use it only once in the process), the usage of multiple libraries seems to be fine.

ReinhardBiegelIntech avatar Nov 16 '21 22:11 ReinhardBiegelIntech

Feedback from my colleague Markus Schönbeck (sry it is German):

  • Wenn man nicht den Sourcecode aller Komponenten unter Kontrolle hat, kann es dennoch zu diesem Problem kommen, wir haben keine Garantie, dass dies nicht benutzt wird.
  • Letztendlich sollte dieser Fehler vollständig ausgeschlossen werden (wie von OpenPath anscheinend ja auch gewünscht).
  • Etwas, was vorhanden ist, nicht zu benutzen, weil es sonst zu Problemen kommt, ist ein Design-Fehler ((selbst wenn der Workaround bei OpenPath zu funktionieren scheint).

ThomasNaderBMW avatar Nov 19 '21 08:11 ThomasNaderBMW

Related: https://github.com/protocolbuffers/protobuf/issues/6029

ReinhardBiegelIntech avatar May 18 '22 07:05 ReinhardBiegelIntech