-
Notifications
You must be signed in to change notification settings - Fork 363
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
Interoperability Error: keyhash is MD5 and can't be converted to key value #1927
Comments
The first line is indicative of a difference in interpretation of the serialisation format. It may be a bug we have fixed since the 0.10.x branch, but Thus, if this isn't The other two are (in all cases I am aware of, anyway) caused by RTI's cavalierly sending data without a payload. The DDSI spec does need to allow for this combination because it is needed for ending a coherent set in the absence of new data but nowhere (as far as I know) does it say that the payload can be omitted for a regular sample. To me, it also stands to reason that if one sends a What they send instead is the "key hash" (which is optional to begin with1). That key hash is a funny thing. It has special serialisation rules and if the upper bound of the serialised key length exceeds 16 bytes, the key hash is the MD5 of that special serialisation. Because, well, surely x ≠ y ⇒ MD5(x) ≠ MD5(y) 2 There have been various debates among those involved in Cyclone on what the correct key hash serialisation is various cases in XTypes because the spec is so unclear. These differences even affect the length of the serialised key, and so in some cases these two interpretations also differ in whether the key hash is the MD5 of the serialised key or the (padded) serialised key itself. If it's caused by that, then it is still a problem of a different interpretation of the intended serialised representation, of course. Fortunately, I have heard of a setting on the DataWriter in Connext that forces it to send serialised keys instead of just this key hash. You might want to look for Footnotes
|
Thank you for your answer @eboasson. Yes i was using Version 0.10.4. It was challenging to build the
With some manual quick and dirty patches i was able to compile I also have started a support case on the rti side to ask for the When errors appear between two different DDS-Vendors its so hard to decide which Vendor to ask, "who is to blame" 🙈. In the mean time @eboasson shall i provide Wireshark data of that message that i want to send from rti to cyclone? |
That + the IDL would be a good first step. It would also be useful to also have the serialised data that Cyclone generates for the same sample: that makes it possible to play a game of "spot the differences". What would of course be ideal is a simple reproducer that writes that one sample that doesn't get decoded, that would automatically give us the IDL and the Cyclone output 🙂 It would also make it easier to inspect what it is actually doing. But that may be a bit much to ask for ... The data type definition looks like a standard ("GVA" is suggestive), but sometimes contents can also be sensitive. If some of this is data that can't be shared publicly, contact me privately to see what we can do. |
@eboasson i nailed it down. It turns out that there is a problem with It can be reproduced with the following IDL.
As long as i dont put any data into My_Test_Module::Optional_Test_Data optData;
optData.optId({4}); // it works without this line
writer.write(optData); I attached 3 wireshark logs and the source code.
@eboasson could you please have a look into the data? 🙏🏻 |
@trittsv I think the captures used the wrong network interface because the only packets are the participant discovery ones. (In the case of RTI-only it is also possible that it needs to be told to avoid shared memory and use UDP instead). Whenever this happens to me, invariably I selected the ethernet in Wireshark but the kernel routed the traffic over loopback, and selecting loopback then solves the problem. There should be a regular "DATA", not just "DATA(p)" in there. |
@eboasson sorry my mistake, here is hopefully the correct one (?): At least in rti-to-cyclone there are now these |
There's a lot more now, definitely, and the Cyclone-to-Cyclone capture definitely has it:
but in the RTI-to-Cyclone, I do see all the discovery but not the application data. If you get the "deserialization failed", then the data must have been sent (otherwise I would've assumed a type assignability check problem), but then ... where is it? (You could try the |
@eboasson i did some more recordings with the cyclone wireshark feature, i also captured DATA from rti to rti via to PCs. rti to rti (works)
cyclone-to-rti: (works - data arrived in rti)
rti-to-cyclone: (fails) How do i have to understand the spec https://www.omg.org/spec/DDS-XTypes/1.2/PDF
does not have |
I figured it out, it is RTI's "fault" but not in the way I had expected, and I also expect them to they disagree with this blame assignment. You're correct about the
The That leaves us with three questions:
Re 1: that's been described elsewhere in comments quite a few times. The reasoning is very simple: if you take a system that predates XTypes and you build half of it with a DDS implementation that doesn't support XTypes and the other half with one that does (e.g., old Cyclone and new Cyclone), you end up with a broken system. There will not be any assignability checking between the two because of the effort spent on backwards compatibility, but they will use different serialisation rules and so the "old" half will silently misinterpret the data. In my view, that's such a blatant violation of backwards compatibility that the only option is to deviate from the spec and use a different default. Interoperation with a proper XTypes-capable DDS implementation that uses Re 2: Cyclone simply follows the spec (apart from the default extensibility) and the spec spells out what encoding the writer needs to use given the type. Cyclone deliberately rejects anything with the wrong encoding, because who can trust a writer that uses the wrong encoding? This is of course something that could be done differently. There is one deserialiser for all the encodings, so it is not difficult to do what RTI does and accept anything that can be deserialised. That would be in line with the old adage about being liberal in what one accepts — but I think the many security incidents of the past decade (or more) have shown that trying to be helpful often leads to vulnerabilities. I am not saying there is one here, just that I no longer believe in the wisdom of that adage. Re 3: this is where it gets interesting. The "type consistency" QoS setting of the data reader doesn't have the "force type validation" flag set, so it doesn't require assignability checking and do it only if the type information is available. Cyclone sends the standardised So, there is no possibility for Cyclone of doing an assignability check and it can only check the type name (cf. the note in XTypes 1.3 7.6.3.2.2). RTI could do an assignability check, but presumably didn't because there is little reason to send the data if there are no matching subscribers. It is also possible that they did, decided it didn't match but just multicast the data anyway, regardless of whether there are any subscribers. Why one would do that, I don't know, but it could be. In short, had RTI sent type information as spec'd instead of only doing something vendor-specific, everything would have been handled by the book, and the only spec deviation would've been the default extensibility in Cyclone, for which I think there is a valid argument. And, thus, to me number 3 is the problem that causes the deserialisation failure and it is RTI's fault. P.S. I can't be bothered to try right now, but I consider it well-nigh certain that Cyclone + OpenDDS would've gone by the book ... |
Hey, i receive the following error using cyclonedds-cxx 0.10.4:
What have gone wrong here and how to fix?
I try to receive a message from rti connext.
Using the following idl file:
The text was updated successfully, but these errors were encountered: