Repository navigation
Reallocate default-initialized strings once on deserialization - #87
Merged
Merged
Conversation
Signed-off-by: David Laseca Perez <davidlaseca@eprosima.com>
Signed-off-by: David Laseca Perez <davidlaseca@eprosima.com>
Contributor
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
David-LP99
added a commit
to micro-ROS/micro_ros_renesas_testbench
that referenced
this pull request
Oct 14, 2026
The rolling parameter server requests fail to deserialize on the board because rclc preallocates the request strings with capacity 1. Clone the typesupport from the fix/string_reservation_v3 branch in every component until micro-ROS/rosidl_typesupport_microxrcedds#87 is merged, and print the commit each library was built with. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR addresses received strings that are still in the state left by
rosidl_runtime_c__String__init()(capacity 1). Since strings are deserialized in place, those buffers can only hold an empty string, so longer ones are skipped.Before ros2/rclc#455, the default size was 50, which allow not having to reallocate. This broke, for example, the
rclcparameter server requests. Those buffers are now reallocated once to a reserved size, while user-provided buffers are left untouched.Main changes
rosidl_typesupport_microxrcedds_c__deserialize_string()tomessage_type_support.h, used by the message template for both single strings and string sequencesROSIDL_TYPESUPPORT_MICROXRCEDDS_C_STRING_RESERVATIONbytes (50 by default,0disables it). Strings longer than the reservation are still skipped without reallocatingrcutilsdependency inpackage.xmlandCMakeLists.txt-DROSIDL_TYPESUPPORT_MICROXRCEDDS_C_STRING_RESERVATION=<n>toCMAKE_C_FLAGS. This does not reach the tests, which are C++ and keep using the default valuetest_string_reservation.cpp, covering the reservation limit, string sequences, user-provided buffers and the alignment of the members following a string