-
Notifications
You must be signed in to change notification settings - Fork 44
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
Change expected rmw GID array size to 16 bytes #138
Change expected rmw GID array size to 16 bytes #138
Conversation
The size changed from 24 to 16 bytes in ros2/rmw#345. The same size is defined in `tracetools`, and it was never updated. In practice, reading 24-16=8 random extra bytes didn't change much, since nothing is currently relying on the GID values, at least not relying on getting the same GID for the same object from two different systems, because it doesn't work with `rmw_cyclonedds`, see ros2/rmw_cyclonedds#377. Signed-off-by: Christophe Bedard <[email protected]>
Defining the same value as |
It probably won't, so this should be safe. But out of curiousity, could we make |
I think this would be technically possible, but it would mean that no packages that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Yeah, that's fair. It sounds like you've already thought this through, so I'm fine with this change as-is. I'll approve, and we can run CI on it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me with green CI.
Another option (and probably the right one) would be to make the diff --git a/tracetools/include/tracetools/tp_call.h b/tracetools/include/tracetools/tp_call.h
index c56dc1b..07edb84 100644
--- a/tracetools/include/tracetools/tp_call.h
+++ b/tracetools/include/tracetools/tp_call.h
@@ -76,11 +76,12 @@ TRACEPOINT_EVENT(
rmw_publisher_init,
TP_ARGS(
const void *, rmw_publisher_handle_arg,
- const uint8_t *, gid_arg
+ const uint8_t *, gid_arg,
+ const size_t, gid_len_arg
),
TP_FIELDS(
ctf_integer_hex(const void *, rmw_publisher_handle, rmw_publisher_handle_arg)
- ctf_array(uint8_t, gid, gid_arg, TRACETOOLS_GID_STORAGE_SIZE)
+ ctf_array(uint8_t, gid, gid_arg, gid_len_arg)
)
) Then diff --git a/rmw_cyclonedds_cpp/src/rmw_node.cpp b/rmw_cyclonedds_cpp/src/rmw_node.cpp
index af64110..066a9d2 100644
--- a/rmw_cyclonedds_cpp/src/rmw_node.cpp
+++ b/rmw_cyclonedds_cpp/src/rmw_node.cpp
@@ -2630,7 +2630,7 @@ extern "C" rmw_publisher_t * rmw_create_publisher(
}
cleanup_publisher.cancel();
- TRACETOOLS_TRACEPOINT(rmw_publisher_init, static_cast<const void *>(pub), cddspub->gid.data);
+ TRACETOOLS_TRACEPOINT(rmw_publisher_init, static_cast<const void *>(pub), cddspub->gid.data, RMW_GID_STORAGE_SIZE);
return pub;
} This removes the duplication, except for the literals in |
There's a |
Note: ros2/rmw#345 was merged in January 2023, so Iron and Jazzy have 16-byte |
The size changed from 24 to 16 bytes in ros2/rmw#345. The same size is defined in
tracetools
, and it was never updated.In practice, reading 24-16=8 random extra bytes didn't change much, since nothing is currently relying on the GID values, at least not relying on getting the same GID for the same object from two different systems, because it doesn't work with
rmw_cyclonedds
, see ros2/rmw_cyclonedds#377.