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

moveit_ros_control_interface: Fix dangling reference #710

Merged
merged 2 commits into from
Sep 29, 2021

Conversation

JafarAbdi
Copy link
Contributor

Description

Checklist

  • Required by CI: Code is auto formatted using clang-format
  • Extend the tutorials / documentation reference
  • Document API changes relevant to the user in the MIGRATION.md notes
  • Create tests, which fail without this PR reference
  • Include a screenshot if changing a GUI
  • While waiting for someone to review your request, please help review another open pull request to support the maintainers

@codecov
Copy link

codecov bot commented Sep 29, 2021

Codecov Report

Merging #710 (069ed67) into main (1843da4) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #710   +/-   ##
=======================================
  Coverage   54.18%   54.18%           
=======================================
  Files         192      192           
  Lines       20186    20186           
=======================================
  Hits        10935    10935           
  Misses       9251     9251           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1843da4...069ed67. Read the comment docs.

Copy link
Member

@henningkayser henningkayser left a comment

Choose a reason for hiding this comment

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

Are you sure this is a dangling reference? From the code I don't see why this would happen (result_future doesn't go out of scope here). Not knowing your issue, I'd suspect that we are getting an invalid future while the code only checks for timeout.
Side note: is async_send_request() guaranteed to return a valid future?

@JafarAbdi
Copy link
Contributor Author

Are you sure this is a dangling reference? From the code I don't see why this would happen (result_future doesn't go out of scope here). Not knowing your issue, I'd suspect that we are getting an invalid future while the code only checks for timeout.

Yes, I'm pretty sure, see P2012R1 for why this's happening

@henningkayser
Copy link
Member

henningkayser commented Sep 29, 2021

Are you sure this is a dangling reference? From the code I don't see why this would happen (result_future doesn't go out of scope here). Not knowing your issue, I'd suspect that we are getting an invalid future while the code only checks for timeout.

Yes, I'm pretty sure, see P2012R1 for why this's happening

I see, so get() returned a temporary copy instead of a reference so that the message ends up being a dangling reference...

I think it might still make sense to check for valid() in general, but that doesn't need to be part of this fix.

@henningkayser henningkayser merged commit 68553ff into moveit:main Sep 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants