ros2 / ros2cli

ROS 2 command line interface tools
Apache License 2.0
183 stars 164 forks source link

ros2 daemon XML-RPC can't represent 64-bit integers #629

Open clalancette opened 3 years ago

clalancette commented 3 years ago

While investigating https://github.com/ros2/ros2cli/issues/603 , we found out that XML-RPC only supports 32-bit signed integers: http://xmlrpc.com/spec.md . Since this is used as the communication mechanism between the ros2 daemon and clients, this could be a problem in the future. We worked around that problem for the above issue by forcing the depth number in question to 0 (see https://github.com/ros2/rmw_cyclonedds/pull/305), but that won't always work.

The potential solutions are:

  1. Switch to using strings for all values in XML-RPC. We'd then have to marshal back-and-forth between integers and strings as needed.
  2. Switch to a different protocol that allows more modern types. The XML-RPC spec seems to have been last updated in 2003, so may not be up to the task anymore.

There may be other options here, but we should figure out a real solution.

clalancette commented 3 years ago

From https://github.com/ros2/rmw_cyclonedds/pull/305#issuecomment-823818907 :+1:

In general, yes; but as the DDS spec has a signed 32-bit integer for the depth (don't know why, I suspect Java) and as 2 billion really is a pretty unreasonable value, I think it is highly unlikely there is any code out there that tries to use a depth ≥2^31. I think you could also quite reasonably limit the depth in ROS 2 to 2^31-1 without causing any problems.