rosbag memory leak at ros ClassLoader [closed]

asked 2020-05-03 22:09:40 -0500

The memory leak is reported when a rosbag object is created and destroyed. Here is the full stack trace reported by LeakSanitizer.

10:59:59: Starting /media/user/docker/catkin_ws/build/catkin/devel/lib/catkin/catkin_test --log_dir="/media/user/Seagate/user/temp/catkin_test_log" --gtest_filter="*Rosbag*"...
Note: Google Test filter = *Rosbag*
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from Rosbag
[ RUN      ] Rosbag.ClassLoader
unknown file: Failure
C++ exception with description "Error opening file: path/to/ros.bag" thrown in the test body.
[  FAILED  ] Rosbag.ClassLoader (234 ms)
[----------] 1 test from Rosbag (234 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test case ran. (235 ms total)
[  PASSED  ] 0 tests.
[  FAILED  ] 1 test, listed below:
[  FAILED  ] Rosbag.ClassLoader


==24776==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 48 byte(s) in 1 object(s) allocated from:
    #0 0x7ff4188ec448 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/
    #1 0x7ff4115c28e0 in class_loader::impl::loadLibrary(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, class_loader::ClassLoader*) (/opt/ros/melodic/lib/
    #2 0x7ff4115bc5a3 in class_loader::ClassLoader::loadLibrary() (/opt/ros/melodic/lib/
    #3 0x7ff4115bc777 in class_loader::ClassLoader::ClassLoader(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool) (/opt/ros/melodic/lib/
    #4 0x7ff4115c5b4f in class_loader::MultiLibraryClassLoader::loadLibrary(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (/opt/ros/melodic/lib/
    #5 0x7ff416b8f81e in pluginlib::ClassLoader<rosbag::EncryptorBase>::loadLibraryForClass(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (/opt/ros/melodic/lib/
    #6 0x7ff416b933e4 in pluginlib::ClassLoader<rosbag::EncryptorBase>::createInstance(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (/opt/ros/melodic/lib/
    #7 0x7ff416b89896 in rosbag::Bag::setEncryptorPlugin(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (/opt/ros/melodic/lib/
    #8 0x7ff416b89a8c in rosbag::Bag::init() (/opt/ros/melodic/lib/
    #9 0x7ff416b8b56a in rosbag::Bag::Bag(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int) (/opt/ros/melodic/lib/
    #10 0x5586945fcc52 in Rosbag_ClassLoader_Test::TestBody() /media/user/docker/catkin_ws/src/catkin/test/ros/TestRosbag.cpp:8
    #11 0x7ff4185b56a0 in void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) /usr/src/googletest/googletest/src/
    #12 0x7ff4185a83d0 in void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) /usr/src/googletest/googletest/src/
    #13 0x7ff418561b45 in testing::Test::Run() /usr/src/googletest/googletest/src/
    #14 0x7ff418562ed7 in testing::TestInfo::Run() /usr/src/googletest/googletest/src/
    #15 0x7ff418563a73 in testing::TestCase::Run() /usr/src/googletest/googletest/src/
    #16 0x7ff418574c97 in testing::internal::UnitTestImpl::RunAllTests() /usr/src/googletest/googletest/src/
    #17 0x7ff4185b817d in bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) /usr/src/googletest/googletest/src ...
edit retag flag offensive reopen merge delete

Closed for the following reason question is off-topic or not relevant. Please see for more details. by gvdhoorn
close date 2020-05-04 02:42:47.478148


Thanks for looking into this, but ROS Answers is not a bug tracker. Your report will most likely go unnoticed and not get the attention it deserves.

You should report this sort of thing on the issue tracker of rosbag.

As such, I've closed it as off-topic or not relevant. That's not because I feel it is actually off-topic or not relevant, but because of the reason stated above, and the fact that ROS Answers doesn't have a better category for this (duplicate question is also not appropriate).

gvdhoorn gravatar image gvdhoorn  ( 2020-05-04 02:42:29 -0500 )edit