Skip to content

moveit_ros_control_interface: Fix dangling reference#710

Merged
henningkayser merged 2 commits intomoveit:mainfrom
JafarAbdi:pr-fix_service_call
Sep 29, 2021
Merged

moveit_ros_control_interface: Fix dangling reference#710
henningkayser merged 2 commits intomoveit:mainfrom
JafarAbdi:pr-fix_service_call

Conversation

@JafarAbdi
Copy link
Copy Markdown
Member

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

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

2 participants