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 deleting ogre2 when created (and deleted) in a thread #840

Merged
merged 2 commits into from Apr 7, 2023

Conversation

iche033
Copy link
Contributor

@iche033 iche033 commented Apr 7, 2023

🦟 Bug fix

Summary

I ran into a crash in gz-sim on exit after unloading the ogre2 render engine. It was found that it only happens if ogre-next is built with EGL support and the engine is created / deleted in a thread. The fix is to make sure EGL returns to its original state, specifically by calling eglReleaseThread() after deleting ogre root.

The fix this PR make EGL calls which requires including and linking against the EGL library, hence the extra cmake code. The proper fix may be to do this inside ogre.

To Test:

Run the INTEGRATION_load_unload test

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.

Signed-off-by: Ian Chen <ichen@openrobotics.org>
@osrf-triage osrf-triage added this to Inbox in Core development Apr 7, 2023
@github-actions github-actions bot added the 🌱 garden Ignition Garden label Apr 7, 2023
@iche033 iche033 changed the title ogre2 when created (and deleted) in a thread Fix deleting ogre2 when created (and deleted) in a thread Apr 7, 2023
Signed-off-by: Ian Chen <ichen@openrobotics.org>
@codecov
Copy link

codecov bot commented Apr 7, 2023

Codecov Report

Merging #840 (9062d6f) into gz-rendering7 (c2e72ee) will increase coverage by 0.00%.
The diff coverage is 91.66%.

❗ Current head 9062d6f differs from pull request most recent head f6e2798. Consider uploading reports for the commit f6e2798 to get more accurate results

@@              Coverage Diff               @@
##           gz-rendering7     #840   +/-   ##
==============================================
  Coverage          77.37%   77.37%           
==============================================
  Files                164      164           
  Lines              14456    14460    +4     
==============================================
+ Hits               11185    11189    +4     
  Misses              3271     3271           
Impacted Files Coverage Δ
ogre2/src/Ogre2RenderEngine.cc 76.13% <91.66%> (+0.18%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Core development automation moved this from Inbox to In review Apr 7, 2023
@iche033 iche033 merged commit 0baed7c into gz-rendering7 Apr 7, 2023
10 of 12 checks passed
Core development automation moved this from In review to Done Apr 7, 2023
@iche033 iche033 deleted the ogre2_egl_thread branch April 7, 2023 22:17
@azeey
Copy link
Contributor

azeey commented Apr 7, 2023

Not sure if this should've been merged with the homebrew failures. The stable branch is green https://build.osrfoundation.org/view/ign-garden/job/ignition_rendering-ci-gz-rendering7-homebrew-amd64/

@iche033
Copy link
Contributor Author

iche033 commented Apr 10, 2023

testing changes in #841 to see if it fixes the crash on macOS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌱 garden Ignition Garden
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants