Skip to content

Fix for memory leaks in the rclcpp::SerializedMessage #2861

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

Open
wants to merge 1 commit into
base: rolling
Choose a base branch
from

Conversation

MichaelOrlov
Copy link
Contributor

Description

This PR fixes memory leaks found in the rclcpp::SerializedMessage copy assignment operators

Fixes # (issue) N/A

Is this user-facing behavior change?

No

Did you use Generative AI?

No.

Additional Information

These memory leaks were found with memory sanitizer.

@MichaelOrlov MichaelOrlov marked this pull request as ready for review May 27, 2025 19:11
@MichaelOrlov
Copy link
Contributor Author

cc: @kylemarcey

Signed-off-by: Michael Orlov <morlovmr@gmail.com>
Co-authored-by: kylemarcey <marcey.kyle@gmail.com>
Signed-off-by: Michael Orlov <michael.orlov@apex.ai>
@MichaelOrlov MichaelOrlov force-pushed the morlov/fix-memory-leaks-in-serialized-message branch from adffd3c to 1e5cd9c Compare May 27, 2025 19:14
Copy link
Member

@christophebedard christophebedard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Collaborator

@fujitatomoya fujitatomoya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm with green CI.

@jmachowinski
Copy link
Collaborator

lgtm.

Did these leaks have any real effect in nominal usage or would they only occur under 'weird' usage ?

@ahcorde
Copy link
Contributor

ahcorde commented May 28, 2025

Pulls: #2861
Gist: https://gist.githubusercontent.com/ahcorde/d3d10afe76aeff0e9c672930dc6d8071/raw/338ffd2c69c7401414fb83557ff866e414f269ef/ros2.repos
BUILD args: --packages-above-and-dependencies rclcpp
TEST args: --packages-above rclcpp
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/16087

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants