Memory leak in test_kstate

Bug #1349303 reported by Praveen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenContrail
Fix Committed
High
Praveen

Bug Description

praveen@praveen-VirtualBox:~/ctrlplane$ ./build/debug/vnsw/agent/kstate/test/test_kstate
WARNING: Perftools heap leak checker is active -- Performance may suffer
Config file <controller/src/vnsw/agent/test/vnswa_cfg.ini> parsing completed.
log4cplus:ERROR No appenders could be found for logger (root).
log4cplus:ERROR Please initialize the log4cplus system properly.
[==========] Running 10 tests from 1 test case.
[----------] Global test environment set-up.
[----------] 10 tests from KStateTest
[ RUN ] KStateTest.IfDumpTest
[ OK ] KStateTest.IfDumpTest (287 ms)
[ RUN ] KStateTest.IfGetTest
[ OK ] KStateTest.IfGetTest (233 ms)
[ RUN ] KStateTest.NHDumpTest
[ OK ] KStateTest.NHDumpTest (98 ms)
[ RUN ] KStateTest.NHGetTest
[ OK ] KStateTest.NHGetTest (231 ms)
[ RUN ] KStateTest.MplsDumpTest
[ OK ] KStateTest.MplsDumpTest (204 ms)
[ RUN ] KStateTest.MplsGetTest
[ OK ] KStateTest.MplsGetTest (190 ms)
[ RUN ] KStateTest.MirrorNHGetTest
[ OK ] KStateTest.MirrorNHGetTest (11 ms)
[ RUN ] KStateTest.MirrorDumpTest
[ OK ] KStateTest.MirrorDumpTest (8 ms)
[ RUN ] KStateTest.MirrorGetTest
[ OK ] KStateTest.MirrorGetTest (10 ms)
[ RUN ] KStateTest.RouteDumpTest
[ OK ] KStateTest.RouteDumpTest (197 ms)
[----------] 10 tests from KStateTest (1470 ms total)

[----------] Global test environment tear-down
[==========] 10 tests from 1 test case ran. (1470 ms total)
[ PASSED ] 10 tests.

  YOU HAVE 1 DISABLED TEST

Leak check _main_ detected leaks of 29301 bytes in 404 objects
The 20 largest leaks:
Using local file ./build/debug/vnsw/agent/kstate/test/test_kstate.
Leak of 9504 bytes in 14 objects allocated from:
 @ 149e32c __gnu_cxx::new_allocator::allocate
 @ 1499db9 std::_Vector_base::_M_allocate
 @ 14a7f34 std::vector::_M_insert_aux
 @ 14a7731 std::vector::push_back
 @ 14a516f KState::NHMsgHandler
 @ 14165fc vr_nexthop_req::Process
 @ 18173fb Sandesh::ReceiveBinaryMsgOne
 @ 14557b7 KSyncSockTypeMap::Decoder
 @ 14420df KSyncSock::ProcessKernelData
 @ 1451a93 boost::_mfi::mf1::operator
 @ 1450308 boost::_bi::list2::operator
 @ 144dcfa boost::_bi::bind_t::operator
 @ 144b4b1 boost::detail::function::function_obj_invoker1::invoke
 @ 1453261 boost::func
Leak of 3200 bytes in 7 objects allocated from:
 @ 149e1d8 __gnu_cxx::new_allocator::allocate
 @ 1499cd7 std::_Vector_base::_M_allocate
 @ 14a7bd0 std::vector::_M_insert_aux
 @ 14a76b3 std::vector::push_back
 @ 14a4cf4 KState::IfMsgHandler
 @ 134e3cc vr_interface_req::Process
 @ 18173fb Sandesh::ReceiveBinaryMsgOne
 @ 14557b7 KSyncSockTypeMap::Decoder
 @ 14420df KSyncSock::ProcessKernelData
 @ 1451a93 boost::_mfi::mf1::operator
 @ 1450308 boost::_bi::list2::operator
 @ 144dcfa boost::_bi::bind_t::operator
 @ 144b4b1 boost::detail::function::function_obj_invoker1::invoke
 @ 1453261 boost::fun
Leak of 1489 bytes in 44 objects allocated from:
 @ 7f29b030ea89 std::basic_string::_Rep::_S_create
Leak of 1440 bytes in 45 objects allocated from:
 @ 7f29b030ea89 std::basic_string::_Rep::_S_create
 @ 7f2900000001 0x00007f2900000001
Leak of 1120 bytes in 10 objects allocated from:
 @ 11b0bdb TestNHKState::Init
 @ 11aa421 KStateTest_NHGetTest_Test::TestBody
 @ 12220b4 testing::internal::HandleSehExceptionsInMethodIfSupported
 @ 121d4c0 testing::internal::HandleExceptionsInMethodIfSupported
 @ 120af9d testing::Test::Run
 @ 120b6f4 testing::TestInfo::Run
 @ 120bc9b testing::TestCase::Run
 @ 121097a testing::internal::UnitTestImpl::RunAllTests
 @ 1223155 testing::internal::HandleSehExceptionsInMethodIfSupported
 @ 121e1dc testing::internal::HandleExceptionsInMethodIfSupported
 @ 120f72a testing::UnitTest::Run
 @ 11ac3ab mai
Leak of 1060 bytes in 20 objects allocated from:
 @ 7f29b030ea89 std::basic_string::_Rep::_S_create
 @ 1407ecf __gnu_cxx::operator!=
 @ 14ab4bc NHKState::EncapToString
 @ 14a511a KState::NHMsgHandler
 @ 14165fc vr_nexthop_req::Process
 @ 18173fb Sandesh::ReceiveBinaryMsgOne
 @ 14557b7 KSyncSockTypeMap::Decoder
 @ 14420df KSyncSock::ProcessKernelData
 @ 1451a93 boost::_mfi::mf1::operator
 @ 1450308 boost::_bi::list2::operator
 @ 144dcfa boost::_bi::bind_t::operator
 @ 144b4b1 boost::detail::function::function_obj_invoker1::invoke
 @ 1453261 boost::function1::operator
 @ 1452dec QueueTaskRunne
Leak of 891 bytes in 26 objects allocated from:
 @ 7f29b030ea89 std::basic_string::_Rep::_S_create
 @ 7fff021890a0 0x00007fff021890a0
Leak of 800 bytes in 10 objects allocated from:
 @ 11b0c19 TestNHKState::Init
 @ 11aa421 KStateTest_NHGetTest_Test::TestBody
 @ 12220b4 testing::internal::HandleSehExceptionsInMethodIfSupported
 @ 121d4c0 testing::internal::HandleExceptionsInMethodIfSupported
 @ 120af9d testing::Test::Run
 @ 120b6f4 testing::TestInfo::Run
 @ 120bc9b testing::TestCase::Run
 @ 121097a testing::internal::UnitTestImpl::RunAllTests
 @ 1223155 testing::internal::HandleSehExceptionsInMethodIfSupported
 @ 121e1dc testing::internal::HandleExceptionsInMethodIfSupported
 @ 120f72a testing::UnitTest::Run
 @ 11ac3ab main
Leak of 628 bytes in 20 objects allocated from:
 @ 7f29b030ea89 std::basic_string::_Rep::_S_create
 @ 1 _init
Leak of 618 bytes in 20 objects allocated from:
 @ 7f29b030ea89 std::basic_string::_Rep::_S_create
 @ 7f29b05a8e35 tc_delete
 @ 7f29aeb28860 0x00007f29aeb28860
Leak of 573 bytes in 17 objects allocated from:
 @ 7f29b030ea89 std::basic_string::_Rep::_S_create
 @ 7f29b03264a8 __cxxabiv1::__si_class_type_info::__do_dyncast
 @ 2ba43c0 0x0000000002ba43c0
Leak of 480 bytes in 5 objects allocated from:
 @ 149e47f __gnu_cxx::new_allocator::allocate
 @ 1499e9b std::_Vector_base::_M_allocate
 @ 14a856f std::vector::_M_insert_aux
 @ 14a7826 std::vector::push_back
 @ 14a54d9 KState::MplsMsgHandler
 @ 14120f4 vr_mpls_req::Process
 @ 18173fb Sandesh::ReceiveBinaryMsgOne
 @ 14557b7 KSyncSockTypeMap::Decoder
 @ 14420df KSyncSock::ProcessKernelData
 @ 1451a93 boost::_mfi::mf1::operator
 @ 1450308 boost::_bi::list2::operator
 @ 144dcfa boost::_bi::bind_t::operator
 @ 144b4b1 boost::detail::function::function_obj_invoker1::invoke
 @ 1453261 boost::functio
Leak of 450 bytes in 15 objects allocated from:
 @ 7f29b030ea89 std::basic_string::_Rep::_S_create
 @ 400000001 0x0000000400000001
Leak of 448 bytes in 4 objects allocated from:
 @ 11b00f9 TestIfKState::Init
 @ 11aa0ab KStateTest_IfGetTest_Test::TestBody
 @ 12220b4 testing::internal::HandleSehExceptionsInMethodIfSupported
 @ 121d4c0 testing::internal::HandleExceptionsInMethodIfSupported
 @ 120af9d testing::Test::Run
 @ 120b6f4 testing::TestInfo::Run
 @ 120bc9b testing::TestCase::Run
 @ 121097a testing::internal::UnitTestImpl::RunAllTests
 @ 1223155 testing::internal::HandleSehExceptionsInMethodIfSupported
 @ 121e1dc testing::internal::HandleExceptionsInMethodIfSupported
 @ 120f72a testing::UnitTest::Run
 @ 11ac3ab main
Leak of 448 bytes in 4 objects allocated from:
 @ 11b1588 TestMplsKState::Init
 @ 11aa5de KStateTest_MplsGetTest_Test::TestBody
 @ 12220b4 testing::internal::HandleSehExceptionsInMethodIfSupported
 @ 121d4c0 testing::internal::HandleExceptionsInMethodIfSupported
 @ 120af9d testing::Test::Run
 @ 120b6f4 testing::TestInfo::Run
 @ 120bc9b testing::TestCase::Run
 @ 121097a testing::internal::UnitTestImpl::RunAllTests
 @ 1223155 testing::internal::HandleSehExceptionsInMethodIfSupported
 @ 121e1dc testing::internal::HandleExceptionsInMethodIfSupported
 @ 120f72a testing::UnitTest::Run
 @ 11ac3ab m
Leak of 436 bytes in 14 objects allocated from:
 @ 7f29b030ea89 std::basic_string::_Rep::_S_create
 @ 7f29b05a8e35 tc_delete
 @ 7f29ae727860 0x00007f29ae727860
Leak of 420 bytes in 10 objects allocated from:
 @ 7f29b030ea89 std::basic_string::_Rep::_S_create
 @ 7f2900000000 0x00007f2900000000
 @ 2aed3d9 0x0000000002aed3d9
Leak of 320 bytes in 4 objects allocated from:
 @ 11b0137 TestIfKState::Init
 @ 11aa0ab KStateTest_IfGetTest_Test::TestBody
 @ 12220b4 testing::internal::HandleSehExceptionsInMethodIfSupported
 @ 121d4c0 testing::internal::HandleExceptionsInMethodIfSupported
 @ 120af9d testing::Test::Run
 @ 120b6f4 testing::TestInfo::Run
 @ 120bc9b testing::TestCase::Run
 @ 121097a testing::internal::UnitTestImpl::RunAllTests
 @ 1223155 testing::internal::HandleSehExceptionsInMethodIfSupported
 @ 121e1dc testing::internal::HandleExceptionsInMethodIfSupported
 @ 120f72a testing::UnitTest::Run
 @ 11ac3ab main
Leak of 320 bytes in 4 objects allocated from:
 @ 11b15c6 TestMplsKState::Init
 @ 11aa5de KStateTest_MplsGetTest_Test::TestBody
 @ 12220b4 testing::internal::HandleSehExceptionsInMethodIfSupported
 @ 121d4c0 testing::internal::HandleExceptionsInMethodIfSupported
 @ 120af9d testing::Test::Run
 @ 120b6f4 testing::TestInfo::Run
 @ 120bc9b testing::TestCase::Run
 @ 121097a testing::internal::UnitTestImpl::RunAllTests
 @ 1223155 testing::internal::HandleSehExceptionsInMethodIfSupported
 @ 121e1dc testing::internal::HandleExceptionsInMethodIfSupported
 @ 120f72a testing::UnitTest::Run
 @ 11ac3ab m
Leak of 256 bytes in 8 objects allocated from:
 @ 7f29b030ea89 std::basic_string::_Rep::_S_create
 @ 3501320 0x0000000003501320
Skipping leaks numbered 20..65

If the preceding stack traces are not enough to find the leaks, try running THIS shell command:

pprof ./build/debug/vnsw/agent/kstate/test/test_kstate "/tmp/test_kstate.16068._main_-end.heap" --inuse_objects --lines --heapcheck --edgefraction=1e-10 --nodefraction=1e-10 --gv

If you are still puzzled about why the leaks are there, try rerunning this program with HEAP_CHECK_TEST_POINTER_ALIGNMENT=1 and/or with HEAP_CHECK_MAX_POINTER_OFFSET=-1
If the leak report occurs in a small fraction of runs, try running with TCMALLOC_MAX_FREE_QUEUE_SIZE of few hundred MB or with TCMALLOC_RECLAIM_MEMOR
Exiting with error code (instead of crashing) because of whole-program memory leaks

Tags: vrouter
Revision history for this message
Ashok Singh (ashoksr) wrote :
Changed in opencontrail:
status: New → Fix Committed
assignee: Ashok Singh (ashoksr) → nobody
assignee: nobody → Praveen (praveen-karadakal)
tags: added: vrouter
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.