-
Notifications
You must be signed in to change notification settings - Fork 276
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
Fix crash in the follow_actor example #958
Conversation
Signed-off-by: Luca Della Vedova <[email protected]>
Codecov Report
@@ Coverage Diff @@
## ign-gazebo4 #958 +/- ##
===============================================
+ Coverage 66.13% 67.06% +0.93%
===============================================
Files 243 243
Lines 18205 18207 +2
===============================================
+ Hits 12039 12210 +171
+ Misses 6166 5997 -169
Continue to review full report at Codecov.
|
2ad47c3
to
fb5964f
Compare
Signed-off-by: Ian Chen <[email protected]>
Signed-off-by: Ian Chen <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice, I can reproduce the crash and this fixes it for me too.
Adding a sensors system and a camera to the follow_actor integration test also causes the test to crash. I've added it in the fix/follow_actor_crash_test branch so we can test the rendering side as part of the integration test in the future. Can you take a look and merge if that looks good to you?
Thanks @luca-della-vedova for catching this! Sorry I didn't notice this when working on #858 😬
Do we need to fix this as well? |
oh I meant adding it to the test causes to crash before the changes in this PR, and confirmed that the test no longer crashes after this PR. |
Signed-off-by: Luca Della Vedova <[email protected]>
Done! |
Signed-off-by: Luca Della Vedova <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me!
Signed-off-by: Luca Della Vedova <[email protected]>
Signed-off-by: Luca Della Vedova <[email protected]>
Signed-off-by: Luca Della Vedova <[email protected]>
This PR fixes a sneaky segfault introduced in #858, while the fix works I'm open to better solutions if anything is recommended (it makes the function arguments a bit bulky).
The issue was that the previous version of the code was relying on an unfortunate coincidence related to the variable names for the
entityPoses
andtrajectoryPoses
data structures, specifically when updating them here the variables would refer to the local variables introduced in the beginning of theUpdate()
function, here.However, when during the refactor the code was moved into a new function, the Implementation class variables (i.e. this and this) with the same name are being silently used behind the scenes, the problem is that at the beginning of the
Update()
function there is astd::move
call that moves from the member data structures into the local variables, hence it becomes a case of using a data structure after it has been moved, which causes a segfault for a null pointer exception in the data pointer.To reproduce the bug / check the PR just run the
follow_actor
demo with and without the PR:ign gazebo follow_actor.sdf