Closed gabrik closed 2 weeks ago
@gabrik was the binary built with support for the 'zenoh-plugin-ros2dds' included?
The ROS2 and DDS plugins use different versions of the cyclors library and it looks like when a binary is built with both of these plugins included there is a clash between the versions. In the stack trace it can be seen that cyclors 0.2.1 is being invoked whereas the DDS plugin should be using cyclors 0.3.1.
Yes, that's the case.
I wonder how this happens as rust builds both version of cyclors
and it should be able to link both versions.
In this case, Cyclone DDS is calling back to Rust when a sample is received. The issue is possibly caused by combining multiple versions of the Cyclone C library into a single binary.
Yeap but:
$ cargo tree -i cyclors --features plugins
error: There are multiple `cyclors` packages in your project, and the specification `cyclors` is ambiguous.
Please re-run this command with one of the following specifications:
cyclors@0.2.1
cyclors@0.3.1
So rust does know that there are 2 different version, and know which plugin belongs to which version
$ cargo tree -i cyclors@0.3.1 --features plugins
cyclors v0.3.1
└── zenoh-plugin-dds v1.0.0-dev (https://github.com/eclipse-zenoh/zenoh-plugin-dds?branch=main#6a12ef01)
└── <redacted> (/home/gabrik/Workspace/<redacted>)
$ cargo tree -i cyclors@0.2.1 --features plugins
cyclors v0.2.1
└── zenoh-plugin-ros2dds v1.0.0-dev (https://github.com/eclipse-zenoh/zenoh-plugin-ros2dds?branch=main#1e53a50b)
└── <redacted> (/home/gabrik/Workspace/<redacted>)
the only way the DDS plugin can call the "wrong" cyclors
is if the underlying C functions are "overwritten" at compile time by the old ones.
~~Cant's cyclors
"mangle" the names including the version? This would prevent this sort of issues.
Or maybe something needs to be setup in cargo configuration~~
Nevermind the underlying CycloneDDS C function will always have the same name, thus it will not solve.
Yes, I think C functions are likely being "overwritten" during linking.
It might be possible to "mangle" the Cyclone symbols (possibly by adding a prefix) to make them unique for each version of Cyclors. This is something that might be worth investigating if we do need to use multiple versions of Cyclone at once.
Solved by #376
Describe the bug
The pluing crashes on discovery of ping/pong participants.
Cause seems:
To reproduce
Start the bridge Start ping pong exampls
System info
All