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

Rendering engines are not unloaded or cleaned up when Server is destroyed #1410

Closed
azeey opened this issue Mar 24, 2022 · 0 comments · Fixed by #1960
Closed

Rendering engines are not unloaded or cleaned up when Server is destroyed #1410

azeey opened this issue Mar 24, 2022 · 0 comments · Fixed by #1960
Labels
bug Something isn't working help wanted We accept pull requests! rendering Involves Ignition Rendering

Comments

@azeey
Copy link
Contributor

azeey commented Mar 24, 2022

Environment

  • OS Version: Ubuntu 20.04
  • Source or binary build? ign-gazebo5

Description

  • Expected behavior: The rendering engine to be unloaded when Server (or more specifically, RenderUtil) is destroyed.
  • Actual behavior: The rendering engine and all the scenes within it remain intact after Server is destroyed. Loading the same world in two tests in the same file causes the test to segfault. @marcoag ran into this while working on Modelpropshop gazebo plugin port #1331.

Steps to reproduce

Add these two tests to test/integration/depth_camera.cc (or any integration test file) and run with --gtest_filter="*Cleanup*"

TEST(RenderingCleanup, Cleanup1)
{
  // Start server
  ServerConfig serverConfig;
  const auto sdfFile = std::string(PROJECT_SOURCE_PATH) +
    "/test/worlds/depth_camera_sensor.sdf";
  serverConfig.SetSdfFile(sdfFile);

  Server server(serverConfig);

  server.Run(true, 10, false);
}

TEST(RenderingCleanup, Cleanup2)
{
  // Start server
  ServerConfig serverConfig;
  const auto sdfFile = std::string(PROJECT_SOURCE_PATH) +
    "/test/worlds/depth_camera_sensor.sdf";
  serverConfig.SetSdfFile(sdfFile);

  Server server(serverConfig);

  server.Run(true, 10, false);
}

Output

❯ bin/INTEGRATION_depth_camera --gtest_filter="*Cleanup*"
Running main() from /home/addisu/ws/edifice/src/ign-gazebo/test/gtest/src/gtest_main.cc
Note: Google Test filter = *Cleanup*
[==========] Running 2 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 2 tests from RenderingCleanup
[ RUN      ] RenderingCleanup.Cleanup1
[       OK ] RenderingCleanup.Cleanup1 (1280 ms)
[ RUN      ] RenderingCleanup.Cleanup2
[Err] [SceneManager.cc:179] Visual: [ground_plane] already exists
[Err] [SceneManager.cc:179] Visual: [box] already exists
[Err] [SceneManager.cc:179] Visual: [depth_camera] already exists
[Err] [BaseStorage.hh:927] Another item already exists with name: sun
[1]    1357836 segmentation fault  bin/INTEGRATION_depth_camera --gtest_filter="*Cleanup*"

@azeey azeey added the bug Something isn't working label Mar 24, 2022
@chapulina chapulina added the rendering Involves Ignition Rendering label Mar 24, 2022
@chapulina chapulina added the help wanted We accept pull requests! label Mar 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted We accept pull requests! rendering Involves Ignition Rendering
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants