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 rendering tests #2086

Merged
merged 10 commits into from
Aug 31, 2023
Merged

Fix rendering tests #2086

merged 10 commits into from
Aug 31, 2023

Conversation

iche033
Copy link
Contributor

@iche033 iche033 commented Aug 22, 2023

#2084

Fixes the following rendering tests that are failing on Jammy CI:

  • INTEGRATION_camera_lens_flare
  • INTEGRATION_camera_video_record_system
  • INTEGRATION_shader_param_system

@iche033 iche033 marked this pull request as draft August 22, 2023 20:53
@github-actions github-actions bot added the 🎵 harmonic Gazebo Harmonic label Aug 22, 2023
Signed-off-by: Ian Chen <[email protected]>
Signed-off-by: Ian Chen <[email protected]>
Signed-off-by: Ian Chen <[email protected]>
@azeey
Copy link
Contributor

azeey commented Aug 25, 2023

I was able to reproduce the test failures locally on gz-sim7. Here's a backtrace in case it helps

(gdb) bt
#0  0x0000555555567597 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x7fffa1c28fb0) at /usr/include/c++/11/bits/shared_ptr_base.h:168
#1  0x00007fffa72cd304 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count (this=0x555557a75e30, __in_chrg=<optimized out>) at /usr/include/c++/11/bits/shared_ptr_base.h:705
#2  std::__shared_ptr<gz::rendering::v7::Material, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr (this=0x555557a75e28, __in_chrg=<optimized out>) at /usr/include/c++/11/bits/shared_ptr_base.h:1154
#3  std::shared_ptr<gz::rendering::v7::Material>::~shared_ptr (this=0x555557a75e28, __in_chrg=<optimized out>) at /usr/include/c++/11/bits/shared_ptr.h:122
#4  gz::sim::v7::systems::ShaderParamPrivate::~ShaderParamPrivate (this=0x555557a75d90, __in_chrg=<optimized out>) at ~/ws/garden/src/gz-sim/src/systems/shader_param/ShaderParam.cc:48
#5  std::default_delete<gz::sim::v7::systems::ShaderParamPrivate>::operator() (this=<optimized out>, __ptr=0x555557a75d90) at /usr/include/c++/11/bits/unique_ptr.h:85
#6  std::default_delete<gz::sim::v7::systems::ShaderParamPrivate>::operator() (__ptr=0x555557a75d90, this=<optimized out>) at /usr/include/c++/11/bits/unique_ptr.h:79
#7  std::unique_ptr<gz::sim::v7::systems::ShaderParamPrivate, std::default_delete<gz::sim::v7::systems::ShaderParamPrivate> >::~unique_ptr (this=<optimized out>, __in_chrg=<optimized out>) at /usr/include/c++/11/bits/unique_ptr.h:361
#8  gz::sim::v7::systems::ShaderParam::~ShaderParam (this=<optimized out>, __in_chrg=<optimized out>) at ~/ws/garden/src/gz-sim/src/systems/shader_param/ShaderParam.cc:132
#9  0x00007fffa72d3319 in gz::sim::v7::systems::ShaderParam::~ShaderParam (this=0x5555574be160, __in_chrg=<optimized out>) at ~/ws/garden/src/gz-sim/src/systems/shader_param/ShaderParam.cc:130
#10 gz::plugin::detail::MakeInfo<gz::sim::v7::systems::ShaderParam, gz::sim::v7::System, gz::sim::v7::ISystemConfigure, gz::sim::v7::ISystemPreUpdate>()::{lambda(void*)#2}::operator()(void*) const (ptr=0x5555574be160, __closure=<optimized out>) at ~/ws/garden/install/include/gz/plugin2/gz/plugin/detail/Common.hh:167
#11 std::__invoke_impl<void, gz::plugin::detail::MakeInfo<gz::sim::v7::systems::ShaderParam, gz::sim::v7::System, gz::sim::v7::ISystemConfigure, gz::sim::v7::ISystemPreUpdate>()::{lambda(void*)#2}&, void*>(std::__invoke_other, gz::plugin::detail::MakeInfo<gz::sim::v7::systems::ShaderParam, gz::sim::v7::System, gz::sim::v7::ISystemConfigure, gz::sim::v7::ISystemPreUpdate>()::{lambda(void*)#2}&, void*&&) (__f=...) at /usr/include/c++/11/bits/invoke.h:61
#12 std::__invoke_r<void, gz::plugin::detail::MakeInfo<gz::sim::v7::systems::ShaderParam, gz::sim::v7::System, gz::sim::v7::ISystemConfigure, gz::sim::v7::ISystemPreUpdate>()::{lambda(void*)#2}&, void*>(gz::plugin::detail::MakeInfo<gz::sim::v7::systems::ShaderParam, gz::sim::v7::System, gz::sim::v7::ISystemConfigure, gz::sim::v7::ISystemPreUpdate>()::{lambda(void*)#2}&, void*&&) (__fn=...) at /usr/include/c++/11/bits/invoke.h:111
#13 std::_Function_handler<void (void*), gz::plugin::detail::MakeInfo<gz::sim::v7::systems::ShaderParam, gz::sim::v7::System, gz::sim::v7::ISystemConfigure, gz::sim::v7::ISystemPreUpdate>()::{lambda(void*)#2}>::_M_invoke(std::_Any_data const&, void*&&) (__functor=..., __args#0=<optimized out>) at /usr/include/c++/11/bits/std_function.h:290
#14 0x00007ffff7538610 in std::function<void (void*)>::operator()(void*) const (this=0x5555574830c8, __args=0x5555574be160) at /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/std_function.h:590
#15 gz::plugin::PluginWithDlHandle::~PluginWithDlHandle (this=0x5555574830b0) at ~/ws/garden/src/gz-plugin/core/src/Plugin.cc:64
#16 0x00007ffff7538a25 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x5555574830a0) at /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/shared_ptr_base.h:168
#17 std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count (this=0x5555574b9888) at /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/shared_ptr_base.h:705
#18 std::__shared_ptr<void, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr (this=0x5555574b9880) at /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/shared_ptr_base.h:1154
#19 gz::plugin::Plugin::Implementation::~Implementation (this=this@entry=0x5555574b9850) at ~/ws/garden/src/gz-plugin/core/src/Plugin.cc:107
#20 0x00007ffff7537216 in std::default_delete<gz::plugin::Plugin::Implementation>::operator() (this=<optimized out>, __ptr=0x5555574b9850) at /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/unique_ptr.h:85
#21 std::unique_ptr<gz::plugin::Plugin::Implementation, std::default_delete<gz::plugin::Plugin::Implementation> >::~unique_ptr (this=0x5555577d0a20) at /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/unique_ptr.h:361
#22 gz::plugin::Plugin::~Plugin (this=this@entry=0x5555577d0a18) at ~/ws/garden/src/gz-plugin/core/src/Plugin.cc:406
#23 0x00007ffff7e2a296 in gz::plugin::SpecializedPlugin<gz::sim::v7::System, gz::sim::v7::ISystemConfigure, gz::sim::v7::ISystemPreUpdate, gz::sim::v7::ISystemUpdate, gz::sim::v7::ISystemPostUpdate>::~SpecializedPlugin (this=this@entry=0x5555577d0a00, __in_chrg=<optimized out>, __vtt_parm=<optimized out>) at ~/ws/garden/install/include/gz/plugin2/gz/plugin/detail/SpecializedPlugin.hh:307
#24 0x00007ffff7e23594 in gz::plugin::SpecializedPlugin<gz::sim::v7::System, gz::sim::v7::ISystemConfigure, gz::sim::v7::ISystemPreUpdate, gz::sim::v7::ISystemUpdate, gz::sim::v7::ISystemPostUpdate>::~SpecializedPlugin (this=0x5555577d0a00, __in_chrg=<optimized out>, __vtt_parm=<optimized out>) at ~/ws/garden/install/include/gz/plugin2/gz/plugin/detail/SpecializedPlugin.hh:307
#25 std::default_delete<gz::plugin::SpecializedPlugin<gz::sim::v7::System, gz::sim::v7::ISystemConfigure, gz::sim::v7::ISystemPreUpdate, gz::sim::v7::ISystemUpdate, gz::sim::v7::ISystemPostUpdate> >::operator() (__ptr=0x5555577d0a00, this=<optimized out>) at /usr/include/c++/11/bits/unique_ptr.h:85
#26 std::unique_ptr<gz::plugin::SpecializedPlugin<gz::sim::v7::System, gz::sim::v7::ISystemConfigure, gz::sim::v7::ISystemPreUpdate, gz::sim::v7::ISystemUpdate, gz::sim::v7::ISystemPostUpdate>, std::default_delete<gz::plugin::SpecializedPlugin<gz::sim::v7::System, gz::sim::v7::ISystemConfigure, gz::sim::v7::ISystemPreUpdate, gz::sim::v7::ISystemUpdate, gz::sim::v7::ISystemPostUpdate> > >::~unique_ptr (this=0x55555771e7a0, __in_chrg=<optimized out>) at /usr/include/c++/11/bits/unique_ptr.h:361
#27 gz::plugin::TemplatePluginPtr<gz::plugin::SpecializedPlugin<gz::sim::v7::System, gz::sim::v7::ISystemConfigure, gz::sim::v7::ISystemPreUpdate, gz::sim::v7::ISystemUpdate, gz::sim::v7::ISystemPostUpdate> >::~TemplatePluginPtr (this=0x55555771e7a0, __in_chrg=<optimized out>) at ~/ws/garden/install/include/gz/plugin2/gz/plugin/PluginPtr.hh:57
#28 gz::sim::v7::SystemInternal::~SystemInternal (this=0x55555771e7a0, __in_chrg=<optimized out>) at ~/ws/garden/src/gz-sim/src/SystemInternal.hh:39
#29 std::_Destroy<gz::sim::v7::SystemInternal> (__pointer=0x55555771e7a0) at /usr/include/c++/11/bits/stl_construct.h:151
#30 std::_Destroy_aux<false>::__destroy<gz::sim::v7::SystemInternal*> (__last=<optimized out>, __first=0x55555771e7a0) at /usr/include/c++/11/bits/stl_construct.h:163
#31 std::_Destroy<gz::sim::v7::SystemInternal*> (__last=<optimized out>, __first=<optimized out>) at /usr/include/c++/11/bits/stl_construct.h:196
#32 std::_Destroy<gz::sim::v7::SystemInternal*, gz::sim::v7::SystemInternal> (__last=0x55555771e920, __first=<optimized out>) at /usr/include/c++/11/bits/alloc_traits.h:848
#33 std::vector<gz::sim::v7::SystemInternal, std::allocator<gz::sim::v7::SystemInternal> >::~vector (this=0x555557ac1a90, __in_chrg=<optimized out>) at /usr/include/c++/11/bits/stl_vector.h:680
#34 gz::sim::v7::SystemManager::~SystemManager (this=0x555557ac1a90, __in_chrg=<optimized out>) at ~/ws/garden/src/gz-sim/src/SystemManager.hh:45
#35 std::default_delete<gz::sim::v7::SystemManager>::operator() (__ptr=0x555557ac1a90, this=<optimized out>) at /usr/include/c++/11/bits/unique_ptr.h:85
#36 0x00007ffff7e2426d in gz::sim::v7::SimulationRunner::~SimulationRunner (this=0x55555568ae80, __in_chrg=<optimized out>) at ~/ws/garden/src/gz-sim/src/SimulationRunner.cc:270
#37 0x00007ffff7e16e97 in std::default_delete<gz::sim::v7::SimulationRunner>::operator() (__ptr=<optimized out>, this=<optimized out>) at /usr/include/c++/11/bits/unique_ptr.h:79
#38 std::unique_ptr<gz::sim::v7::SimulationRunner, std::default_delete<gz::sim::v7::SimulationRunner> >::~unique_ptr (this=0x55555762d6e0, __in_chrg=<optimized out>) at /usr/include/c++/11/bits/unique_ptr.h:361
#39 std::_Destroy<std::unique_ptr<gz::sim::v7::SimulationRunner, std::default_delete<gz::sim::v7::SimulationRunner> > > (__pointer=0x55555762d6e0) at /usr/include/c++/11/bits/stl_construct.h:151
#40 std::_Destroy_aux<false>::__destroy<std::unique_ptr<gz::sim::v7::SimulationRunner, std::default_delete<gz::sim::v7::SimulationRunner> >*> (__last=<optimized out>, __first=0x55555762d6e0) at /usr/include/c++/11/bits/stl_construct.h:163
#41 std::_Destroy<std::unique_ptr<gz::sim::v7::SimulationRunner, std::default_delete<gz::sim::v7::SimulationRunner> >*> (__last=<optimized out>, __first=<optimized out>) at /usr/include/c++/11/bits/stl_construct.h:196
#42 std::_Destroy<std::unique_ptr<gz::sim::v7::SimulationRunner, std::default_delete<gz::sim::v7::SimulationRunner> >*, std::unique_ptr<gz::sim::v7::SimulationRunner, std::default_delete<gz::sim::v7::SimulationRunner> > > (__last=0x55555762d6e8, __first=<optimized out>) at /usr/include/c++/11/bits/alloc_traits.h:848
#43 std::vector<std::unique_ptr<gz::sim::v7::SimulationRunner, std::default_delete<gz::sim::v7::SimulationRunner> >, std::allocator<std::unique_ptr<gz::sim::v7::SimulationRunner, std::default_delete<gz::sim::v7::SimulationRunner> > > >::~vector (this=0x555555664940, __in_chrg=<optimized out>) at /usr/include/c++/11/bits/stl_vector.h:680
#44 gz::sim::v7::ServerPrivate::~ServerPrivate (this=this@entry=0x555555664930, __in_chrg=<optimized out>) at ~/ws/garden/src/gz-sim/src/ServerPrivate.cc:110
#45 0x00007ffff7e083a5 in std::default_delete<gz::sim::v7::ServerPrivate>::operator() (this=<optimized out>, __ptr=0x555555664930) at /usr/include/c++/11/bits/unique_ptr.h:85
#46 std::default_delete<gz::sim::v7::ServerPrivate>::operator() (__ptr=0x555555664930, this=<optimized out>) at /usr/include/c++/11/bits/unique_ptr.h:79
#47 std::unique_ptr<gz::sim::v7::ServerPrivate, std::default_delete<gz::sim::v7::ServerPrivate> >::~unique_ptr (this=<optimized out>, __in_chrg=<optimized out>) at /usr/include/c++/11/bits/unique_ptr.h:361
#48 gz::sim::v7::Server::~Server (this=<optimized out>, __in_chrg=<optimized out>) at ~/ws/garden/src/gz-sim/src/Server.cc:191
#49 0x00005555555649bd in ShaderParamTest_ShaderParam_Test::TestBody (this=<optimized out>) at ~/ws/garden/src/gz-sim/test/integration/shader_param_system.cc:110
#50 0x000055555559dcff in testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void> (location=0x5555555a0639 "the test body", method=<optimized out>, object=0x555555660e50) at ~/ws/garden/src/gz-sim/test/gtest_vendor/src/gtest.cc:2599
#51 testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void> (object=object@entry=0x555555660e50, method=<optimized out>, location=location@entry=0x5555555a0639 "the test body") at ~/ws/garden/src/gz-sim/test/gtest_vendor/src/gtest.cc:2635
#52 0x000055555558dde6 in testing::Test::Run (this=0x555555660e50) at ~/ws/garden/src/gz-sim/test/gtest_vendor/src/gtest.cc:2674
#53 testing::Test::Run (this=0x555555660e50) at ~/ws/garden/src/gz-sim/test/gtest_vendor/src/gtest.cc:2664
#54 0x000055555558e02d in testing::TestInfo::Run (this=0x555555660480) at ~/ws/garden/src/gz-sim/test/gtest_vendor/src/gtest.cc:2853
#55 0x000055555558e733 in testing::TestSuite::Run (this=0x555555609290) at ~/ws/garden/src/gz-sim/test/gtest_vendor/src/gtest.cc:3012
#56 0x000055555559394c in testing::TestSuite::Run (this=<optimized out>) at ~/ws/garden/src/gz-sim/test/gtest_vendor/src/gtest.cc:2986
#57 testing::internal::UnitTestImpl::RunAllTests (this=0x555555660610) at ~/ws/garden/src/gz-sim/test/gtest_vendor/src/gtest.cc:5870
#58 0x000055555559e2c7 in testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> (location=0x5555555a19c0 "auxiliary test code (environments or event listeners)", method=<optimized out>, object=0x555555660610) at ~/ws/garden/src/gz-sim/test/gtest_vendor/src/gtest.cc:2599
#59 testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> (object=0x555555660610, method=<optimized out>, location=location@entry=0x5555555a19c0 "auxiliary test code (environments or event listeners)") at ~/ws/garden/src/gz-sim/test/gtest_vendor/src/gtest.cc:2635
#60 0x000055555558e110 in testing::UnitTest::Run (this=0x5555555b8580 <testing::UnitTest::GetInstance()::instance>) at ~/ws/garden/src/gz-sim/test/gtest_vendor/src/gtest.cc:5444
#61 0x0000555555563cd4 in RUN_ALL_TESTS () at ~/ws/garden/src/gz-sim/test/gtest_vendor/include/gtest/gtest.h:2293
#62 main (argc=<optimized out>, argv=0x7fffffffd0d8) at ~/ws/garden/src/gz-sim/test/gtest_vendor/src/gtest_main.cc:51

@iche033
Copy link
Contributor Author

iche033 commented Aug 26, 2023

oh nice! that looks like from INTEGRATION_shader_param. I managed to fix it after resetting some shared points but now I know it's actually due to the material pointer!

Are you able to repro the INTEGRATION_distortion_camera crash?

Signed-off-by: Ian Chen <[email protected]>
@iche033
Copy link
Contributor Author

iche033 commented Aug 26, 2023

With the latest changes, these 3 long standing rendering test failures should be fixed:

  • INTEGRATION_camera_lens_flare
  • INTEGRATION_camera_video_record_system
  • INTEGRATION_shader_param_system

The last test failure may need to be fixed from out side of gz-sim

  • INTEGRATION_distortion_camera.test

I created gazebosim/gz-rendering#886 that tries to clean up resources properly. Not sure if it'll actually fix the distortion camera test as the test is running ogre (instead of ogre2) and there could be other shutdown problems.

Marking this as ready to have the 3 tests fixed first.

@iche033 iche033 changed the title [IGNORE] Debugging rendering tests Fix rendering tests Aug 26, 2023
@iche033 iche033 marked this pull request as ready for review August 26, 2023 01:59
@codecov
Copy link

codecov bot commented Aug 26, 2023

Codecov Report

Merging #2086 (ce70373) into main (2ae5eb0) will decrease coverage by 0.08%.
Report is 4 commits behind head on main.
The diff coverage is 48.35%.

❗ Current head ce70373 differs from pull request most recent head 16d1db9. Consider uploading reports for the commit 16d1db9 to get more accurate results

@@            Coverage Diff             @@
##             main    #2086      +/-   ##
==========================================
- Coverage   65.37%   65.30%   -0.08%     
==========================================
  Files         320      321       +1     
  Lines       30215    30305      +90     
==========================================
+ Hits        19754    19791      +37     
- Misses      10461    10514      +53     
Files Changed Coverage Δ
python/src/gz/sim/Link.cc 50.00% <ø> (ø)
python/src/gz/sim/Light.cc 45.34% <45.34%> (ø)
python/src/gz/common/_gz_common_pybind11.cc 100.00% <100.00%> (ø)
python/src/gz/sim/TestFixture.cc 82.75% <100.00%> (+0.61%) ⬆️
python/src/gz/sim/_gz_sim_pybind11.cc 100.00% <100.00%> (ø)
src/rendering/SceneManager.cc 31.23% <100.00%> (+0.05%) ⬆️
src/systems/sensors/Sensors.cc 63.18% <100.00%> (+0.09%) ⬆️

... and 1 file with indirect coverage changes

@azeey azeey added the beta Targeting beta release of upcoming collection label Aug 28, 2023
@iche033 iche033 changed the base branch from main to gz-sim8 August 30, 2023 23:59
@iche033 iche033 changed the base branch from gz-sim8 to main August 30, 2023 23:59
Signed-off-by: Ian Chen <[email protected]>
@iche033 iche033 merged commit 197596a into main Aug 31, 2023
4 checks passed
@iche033 iche033 deleted the rendering_test_debugging branch August 31, 2023 02:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta Targeting beta release of upcoming collection 🎵 harmonic Gazebo Harmonic
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants