Skip to content

fix(FTS): shutdown race with interfaces#3492

Open
christophfroehlich wants to merge 2 commits into
masterfrom
fix_fts_shutdown_race
Open

fix(FTS): shutdown race with interfaces#3492
christophfroehlich wants to merge 2 commits into
masterfrom
fix_fts_shutdown_race

Conversation

@christophfroehlich

Copy link
Copy Markdown
Member

Description

  1. force_torque_sensor_broadcaster calls get_values_as_message in update loop.
  2. That calls update_data_from_interfaces.
  3. During deactivation, release_interfaces clears loaned state interfaces.
  4. A final update tick can still run and index state_interfaces[interface_counter], triggering libstdc++ bounds assert and SIGABRT.

Fixes ros-controls/ros2_control_ci#859
Fixes ros-controls/ros2_control_ci#859

Is this user-facing behavior change?

no

Did you use Generative AI?

GPT5.3 Codex

@christophfroehlich christophfroehlich added backport-jazzy Triggers PR backport to ROS 2 jazzy. backport-kilted Triggers PR backport to ROS 2 kilted. labels Jul 21, 2026
@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.54%. Comparing base (4bcce09) to head (546bc04).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3492      +/-   ##
==========================================
+ Coverage   89.51%   89.54%   +0.02%     
==========================================
  Files         164      164              
  Lines       21265    21284      +19     
  Branches     1658     1658              
==========================================
+ Hits        19036    19058      +22     
+ Misses       1530     1528       -2     
+ Partials      699      698       -1     
Flag Coverage Δ
unittests 89.54% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...nclude/semantic_components/force_torque_sensor.hpp 96.00% <100.00%> (ø)
...roller_interface/test/test_force_torque_sensor.cpp 96.55% <100.00%> (+1.02%) ⬆️
...roller_interface/test/test_force_torque_sensor.hpp 100.00% <ø> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.


// Access after release can happen during shutdown/deactivation cycles.
geometry_msgs::msg::Wrench message_after_release;
ASSERT_TRUE(force_torque_sensor_->get_values_as_message(message_after_release));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should this be even true after the release_interfaces is called?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

it is always true as of now:

bool get_values_as_message(geometry_msgs::msg::Wrench & message) const
{
update_data_from_interfaces();
message.force.x = data_[0];
message.force.y = data_[1];
message.force.z = data_[2];
message.torque.x = data_[3];
message.torque.y = data_[4];
message.torque.z = data_[5];
return true;
}

We could change the API of update_data_from_interfaces to return false if the sizes do not match, and early abort here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-jazzy Triggers PR backport to ROS 2 jazzy. backport-kilted Triggers PR backport to ROS 2 kilted.

Projects

Status: Needs review

Development

Successfully merging this pull request may close these issues.

CI build job lyrical/main failed!

2 participants