Skip to content

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

Merged
jacobperron merged 1 commit into
masterfrom
jacob/fix_458
Jan 21, 2021
Merged

jacobperron merged 1 commit into
masterfrom
jacob/fix_458

Conversation

@jacobperron

Copy link
Copy Markdown
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 <[email protected]>
@jacobperron jacobperron added the bug Something isn't working label Dec 22, 2020
@jacobperron jacobperron self-assigned this Dec 22, 2020
@jacobperron
jacobperron requested a review from wjwwood January 7, 2021 00:45

@ivanpauno ivanpauno left a comment

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.

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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