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

Fix locks in Visualize Lidar GUI plugin #1538

Merged
merged 2 commits into from
Jun 16, 2022
Merged

Fix locks in Visualize Lidar GUI plugin #1538

merged 2 commits into from
Jun 16, 2022

Conversation

iche033
Copy link
Contributor

@iche033 iche033 commented Jun 15, 2022

🦟 Bug fix

Fixes #1487

Summary

I ran into segfaults using the Visualize Lidar GUI plugin before. It happens when closing the plugin for me. A crash that could be related to this was reported downstream in osrf/mbzirc#150. This PR fixes obvious locking syntax errors in Visualize Lidar GUI plugin. I also removed the one in OnRefresh as that causes a deadlock.

Checklist

  • Signed all commits for DCO
  • Added tests
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

@iche033 iche033 requested a review from chapulina as a code owner June 15, 2022 21:47
@codecov
Copy link

codecov bot commented Jun 15, 2022

Codecov Report

Merging #1538 (70ffa2e) into ign-gazebo6 (b753afe) will increase coverage by 2.50%.
The diff coverage is n/a.

@@               Coverage Diff               @@
##           ign-gazebo6    #1538      +/-   ##
===============================================
+ Coverage        61.52%   64.03%   +2.50%     
===============================================
  Files              361      316      -45     
  Lines            27733    25462    -2271     
===============================================
- Hits             17063    16304     -759     
+ Misses           10670     9158    -1512     
Impacted Files Coverage Δ
src/gui/plugins/entity_tree/moc_EntityTree.cpp
src/gui/plugins/plot_3d/moc_Plot3D.cpp
src/msgs/peer_info.pb.h
...c/gui/plugins/scene_manager/moc_GzSceneManager.cpp
..._/__/include/ignition/gazebo/gui/moc_GuiSystem.cpp
src/gui/plugins/copy_paste/moc_CopyPaste.cpp
src/gui/plugins/entity_tree/qrc_EntityTree.cpp
src/gui/plugins/lights/moc_Lights.cpp
...gui/plugins/select_entities/moc_SelectEntities.cpp
src/gui/plugins/spawn/qrc_Spawn.cpp
... and 35 more

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 b8c09b6...70ffa2e. Read the comment docs.

@chapulina chapulina added bug Something isn't working GUI Gazebo's graphical interface (not pure Ignition GUI) 🏯 fortress Ignition Fortress labels Jun 15, 2022
Copy link
Contributor

@mjcarroll mjcarroll left a comment

Choose a reason for hiding this comment

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

LGTM. That's a pretty subtle error, those locks weren't doing anything.

Might be worthwhile to do a search to make sure we aren't doing that anywhere else.

@iche033
Copy link
Contributor Author

iche033 commented Jun 16, 2022

Might be worthwhile to do a search to make sure we aren't doing that anywhere else.

just did a grep for "std::mutex>(" and "std::recursive_mutex>(" and only found ones in VisualizeLidar. I think we're safe for now.

@iche033 iche033 merged commit c4dca78 into ign-gazebo6 Jun 16, 2022
@iche033 iche033 deleted the lidar_vis_lock branch June 16, 2022 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 🏯 fortress Ignition Fortress GUI Gazebo's graphical interface (not pure Ignition GUI)
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Race condition in VisualizeLidar.cc due to syntax shenanigan
3 participants