Skip to content
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

Add resources_lock_ lock_guards to avoid race condition when loading robot_description through topic #1451

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

saikishor
Copy link
Member

As reported in #1442, loading the robot_description through the topic will cause a segmentation fault or some undefined behaviors as the read and write methods real-time methods are continuously executed, and when the robot description is received and the resource_manager is to be initialized, there is no lock_guard of recursive mutex resources_lock_, which should avoid the RM to execute the components when they are changing state or being loaded and initialized

Fixes #1442

@saikishor saikishor added backport-humble This label should be used by maintaines only! Label triggers PR backport to ROS2 humble. backport-iron This label should be used by maintaines only! Label triggers PR backport to ROS2 Iron. labels Mar 19, 2024
Copy link
Contributor

@christophfroehlich christophfroehlich left a comment

Choose a reason for hiding this comment

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

LGTM

@firesurfer
Copy link
Contributor

@saikishor I just tested this PR and it seems like the treading/lock issue is gone.
I couldn't test is further as I am running iron on my system and something about the default controllers seems to have changed between iron/rolling.

It can not load the JointStateBroadCaster what(): Failed to load library /opt/ros/iron/lib/libjoint_state_broadcaster.so which is installed from the package repository.
But I guess that is to be expected.

@saikishor
Copy link
Member Author

It can not load the JointStateBroadCaster what(): Failed to load library /opt/ros/iron/lib/libjoint_state_broadcaster.so which is installed from the package repository.
But I guess that is to be expected.

I believe this is related to the ABI/API breaking changes. If you are using this branch directly in rolling, then you would also need to use the master branch of ros2_controllers, control_msgs, and control_toolbox packages

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-humble This label should be used by maintaines only! Label triggers PR backport to ROS2 humble. backport-iron This label should be used by maintaines only! Label triggers PR backport to ROS2 Iron.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Segfault in hardware interface when reading robot_description from topic
3 participants