Open stevemcnamaraultra opened 4 months ago
Looking further at the generator code the function sc_union(
This is quite a serious bug as it prevents Cyclone from being able to publish topics which have unions containing structs. Do we need to open a pull request with a proposed change @eboasson?
isSelfContained
appears to be used in two places only:
memcpy
d without trouble, which in turn determines whether it will allow zero-copy via Iceoryx or not — and here it would forbid it for some types, but I would say it is better to forbid a few cases too many of that in return for having the network communication work.So, yes, it looks to me like your workaround is a very sensible one, and that it would be better to merge it in as an improvement over the current situation. Then we should also create an issue that restore the zero-copy behaviour.
If you can do a PR, that'd be great. I don't seem to manage to fix things as quickly as I used to ...
We have hit an issue with the C++ code generation for topics that use unions which have nested structures.
The issue relates to the isselfcontained() code that is generated. Our topic gets incorrectly marked as self contained. This results in issues if the first publish to the topic uses a smaller union choice than the second.
cycloneBug.zip
The attached zip contains a topic and a test program that reproduces the bug.
The example code shows a publish of the union using the smallest of two supported types and then a publish of the larger.
The second publish fails with the message:
Error Bad Parameter - write failed
Tracing this fault led me to the caching of the topic size that occurs if the topic is not correctly marked as not self contained.
This issue appears to be related, but not the same as, https://github.com/eclipse-cyclonedds/cyclonedds-cxx/issues/461.