-
Notifications
You must be signed in to change notification settings - Fork 342
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue publishing topic with union whose items have nested structs #2005
Comments
Looking further at the generator code the function sc_union() checks each case is self contained but does not check that they would all generate to the same byte size. |
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? |
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, eclipse-cyclonedds/cyclonedds-cxx#461.
The text was updated successfully, but these errors were encountered: