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

Guard against TOCTTOU with rclcpp::ok and rclcpp:spin_some #459

Merged
merged 1 commit into from Jan 21, 2021

Conversation

jacobperron
Copy link
Member

Fixes #458.

An exception can be thrown if an interrupt occurs between checking rclcpp::ok() and rclcpp::spin_some().

Related to ros2/rclcpp#1066

Fixes #458.

An exception can be thrown if an interrupt occurs between checking rclcpp::ok() and rclcpp::spin_some().

Related to ros2/rclcpp#1066

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
@jacobperron jacobperron added the bug Something isn't working label Dec 22, 2020
@jacobperron jacobperron self-assigned this Dec 22, 2020
Copy link
Member

@ivanpauno ivanpauno left a comment

Choose a reason for hiding this comment

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

Looks acceptable, but we should really improve this at some point ...

rclcpp::spin_some(node);
loop_rate.sleep();
}
} catch (const rclcpp::exceptions::RCLError & ex) {
Copy link
Member

Choose a reason for hiding this comment

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

As discussed in other places, we should really fix this issue so this "catch all rcl errors" thing isn't needed (this mechanism can be masking actual errors).

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree. I think this is the most relevant open issue at the moment: ros2/rclcpp#1139

@jacobperron
Copy link
Member Author

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@jacobperron jacobperron merged commit abc8eec into master Jan 21, 2021
@delete-merged-branch delete-merged-branch bot deleted the jacob/fix_458 branch January 21, 2021 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

test_client_scope_cpp can fail with exception
2 participants