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

Controller sorting can cause segfaults when interfaces are created on controller configuring #1164

Closed
fmauch opened this issue Nov 13, 2023 · 2 comments
Assignees
Labels

Comments

@fmauch
Copy link
Contributor

fmauch commented Nov 13, 2023

Describe the bug
There are controllers that specify their interfaces in on_configure such as the force_torque_sensor_broadcaster. Maybe that's an error already then we can close this here and I'll make a PR on the FTS broadcaster.

However that can lead to situations where when the FTS broadcaster is loaded but not yet configured and another controller is configured the controller sorting in configuring the other controller will also check the FTS broadcasterf for sorting. For this it will try to fetch all state and command interfaces which will use the force_torque_sensor_ object which unfortunately is a nullpointer before the FTS broadcaster has been configured.

To Reproduce
Steps to reproduce the behavior:

  1. Make a hardware with a JS broadcaster and an FTS broadcaster.
  2. Load both controllers
  3. configure the JS broadcaster
  4. controller_manager will die

Expected behavior
First of all I would expect things not to crash. One question is whether unconfigured controllers should be used for sorting, as well (see questions below).

Screenshots
I hope the problem is clear without screenshots.

Environment (please complete the following information):

  • OS: ubuntu 22.04
  • Version: Humble (probably also a problem on Iron and Rolling, but I have other issues there, as well.)

Possible solutions / workarounds
I see two possible solutions, but I am not sure which one would be preferred:

  • Is it intentional that controller sorting also considers unconfigured controllers? If so, this is currently violating this statement. We could probably add a switch in the sorting algorithm to check the other controller for being at least configured.
  • Is there a reason why the FTS broadcaster is reading its interface parameter during configuration and not during initialization? Changing this would probably fix the problem (I tested this locally and it helped).
@saikishor
Copy link
Member

Hello @fmauch!

Thank you for reporting the issue. I've addressed the above bug in the linked PR. I've tested it on my end and it works. Please test us and let us know.

Thank you,

Best Regards,
Sai

@bmagyar
Copy link
Member

bmagyar commented Nov 13, 2023

Thank you for helping us help you help us all

mergify bot pushed a commit that referenced this issue Nov 14, 2023
mergify bot pushed a commit that referenced this issue Nov 14, 2023
bmagyar pushed a commit that referenced this issue Nov 14, 2023
…fixes #1164) (#1165) (#1166)

(cherry picked from commit 75e7efd)

Co-authored-by: Sai Kishor Kothakota <sai.kishor@pal-robotics.com>
bmagyar pushed a commit that referenced this issue Nov 14, 2023
…fixes #1164) (#1165) (#1167)

(cherry picked from commit 75e7efd)

Co-authored-by: Sai Kishor Kothakota <sai.kishor@pal-robotics.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants