rclcpp icon indicating copy to clipboard operation
rclcpp copied to clipboard

SEGFAULT in prune_requests_older_than() if pruned_requests are not provided

Open akela1101 opened this issue 4 years ago • 3 comments

Segfault happens here: https://github.com/ros2/rclcpp/blob/dab9f5e0a331b9694c4b5aceb8263d49aa052ecb/rclcpp/include/rclcpp/client.hpp#L772

, if prune_requests_older_than() is called with default argument, while there's matching request to prune:

client->prune_requests_older_than(someTimeAgo /*, nullptr by default */);

The documentation says

[inout] pruned_requests Removed requests id will be pushed to the vector if a pointer is provided.

So I assume no pointer is a valid input.

akela1101 avatar Aug 30 '22 02:08 akela1101

It's hard for me to tell exactly what your problem is from the description.

Nevertheless, if you have a fix that you'd like to see applied, the best thing to do is to create the fix and open it against the rolling branch. Make sure you explain exactly what problem you were having, and how your change fixes it.

Assuming it is reviewed and accepted there, it can be considered for backport to the other stable branches.

clalancette avatar Aug 30 '22 11:08 clalancette

I updated the description and added a PR. Please, check.

akela1101 avatar Aug 30 '22 13:08 akela1101

I updated the description and added a PR. Please, check.

Thanks, that is appreciated.

clalancette avatar Aug 30 '22 13:08 clalancette