[ndnSIM] valgrind on ndn-simple

Marzieh Babaeianjelodar babaeim at clarkson.edu
Fri Jul 21 10:51:12 PDT 2017


Dear ndnSIM friends,

I ran valgrind on ndn-simple and I found this much memory leak, I wanted to ask if this is normal?

marzieh at marzieh-VirtualBox:~/ndnSIM/ns-3$ ./waf --run=ndn-simple --command-template="valgrind --leak-check=yes %s"
Waf: Entering directory `/home/marzieh/ndnSIM/ns-3/build'
Waf: Leaving directory `/home/marzieh/ndnSIM/ns-3/build'
Build commands will be stored in build/compile_commands.json
'build' finished successfully (2.754s)
==6205== Memcheck, a memory error detector
==6205== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==6205== Using Valgrind-3.12.0.SVN and LibVEX; rerun with -h for copyright info
==6205== Command: /home/marzieh/ndnSIM/ns-3/build/src/ndnSIM/examples/ns3-dev-ndn-simple-debug
==6205== 
==6205== 
==6205== HEAP SUMMARY:
==6205==     in use at exit: 13,963 bytes in 226 blocks
==6205==   total heap usage: 152,768 allocs, 152,542 frees, 15,931,040 bytes allocated
==6205== 
==6205== 2,136 (344 direct, 1,792 indirect) bytes in 1 blocks are definitely lost in loss record 115 of 118
==6205==    at 0x402E89C: operator new(unsigned int) (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==6205==    by 0x64B31CB: ns3::TypeId ns3::TypeId::AddConstructor<ns3::ndn::Producer>()::Maker::Create() (type-id.h:596)
==6205==    by 0x40A90A5: ns3::FunctorCallbackImpl<ns3::ObjectBase* (*)(), ns3::ObjectBase*, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::operator()() (callback.h:260)
==6205==    by 0x91E6B41: ns3::Callback<ns3::ObjectBase*, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::operator()() const (callback.h:1092)
==6205==    by 0x95A0907: ns3::ObjectFactory::Create() const (object-factory.cc:99 <http://object-factory.cc:99/>)
==6205==    by 0x64B8CC7: ns3::Ptr<ns3::Application> ns3::ObjectFactory::Create<ns3::Application>() const (object-factory.h:200)
==6205==    by 0x64B8070: ns3::ndn::AppHelper::InstallPriv(ns3::Ptr<ns3::Node>) (ndn-app-helper.cpp:94)
==6205==    by 0x64B7C39: ns3::ndn::AppHelper::Install(ns3::Ptr<ns3::Node>) (ndn-app-helper.cpp:57)
==6205==    by 0x80517CD: ns3::main(int, char**) (ndn-simple.cpp:92)
==6205==    by 0x8051D2F: main (ndn-simple.cpp:107)
==6205== 
==6205== 3,192 (464 direct, 2,728 indirect) bytes in 1 blocks are definitely lost in loss record 117 of 118
==6205==    at 0x402E89C: operator new(unsigned int) (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==6205==    by 0x6487F8C: ns3::TypeId ns3::TypeId::AddConstructor<ns3::ndn::ConsumerCbr>()::Maker::Create() (type-id.h:596)
==6205==    by 0x40A90A5: ns3::FunctorCallbackImpl<ns3::ObjectBase* (*)(), ns3::ObjectBase*, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::operator()() (callback.h:260)
==6205==    by 0x91E6B41: ns3::Callback<ns3::ObjectBase*, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::operator()() const (callback.h:1092)
==6205==    by 0x95A0907: ns3::ObjectFactory::Create() const (object-factory.cc:99 <http://object-factory.cc:99/>)
==6205==    by 0x64B8CC7: ns3::Ptr<ns3::Application> ns3::ObjectFactory::Create<ns3::Application>() const (object-factory.h:200)
==6205==    by 0x64B8070: ns3::ndn::AppHelper::InstallPriv(ns3::Ptr<ns3::Node>) (ndn-app-helper.cpp:94)
==6205==    by 0x64B7C39: ns3::ndn::AppHelper::Install(ns3::Ptr<ns3::Node>) (ndn-app-helper.cpp:57)
==6205==    by 0x80515A1: ns3::main(int, char**) (ndn-simple.cpp:85)
==6205==    by 0x8051D2F: main (ndn-simple.cpp:107)
==6205== 
==6205== 8,115 (552 direct, 7,563 indirect) bytes in 6 blocks are definitely lost in loss record 118 of 118
==6205==    at 0x402E89C: operator new(unsigned int) (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==6205==    by 0x6A1ADBB: __gnu_cxx::new_allocator<std::_Sp_counted_ptr_inplace<nfd::pit::Entry, std::allocator<nfd::pit::Entry>, (__gnu_cxx::_Lock_policy)2> >::allocate(unsigned int, void const*) (new_allocator.h:104)
==6205==    by 0x6A1AC1C: std::allocator_traits<std::allocator<std::_Sp_counted_ptr_inplace<nfd::pit::Entry, std::allocator<nfd::pit::Entry>, (__gnu_cxx::_Lock_policy)2> > >::allocate(std::allocator<std::_Sp_counted_ptr_inplace<nfd::pit::Entry, std::allocator<nfd::pit::Entry>, (__gnu_cxx::_Lock_policy)2> >&, unsigned int) (alloc_traits.h:416)
==6205==    by 0x6A1A9A5: std::__allocated_ptr<std::allocator<std::_Sp_counted_ptr_inplace<nfd::pit::Entry, std::allocator<nfd::pit::Entry>, (__gnu_cxx::_Lock_policy)2> > > std::__allocate_guarded<std::allocator<std::_Sp_counted_ptr_inplace<nfd::pit::Entry, std::allocator<nfd::pit::Entry>, (__gnu_cxx::_Lock_policy)2> > >(std::allocator<std::_Sp_counted_ptr_inplace<nfd::pit::Entry, std::allocator<nfd::pit::Entry>, (__gnu_cxx::_Lock_policy)2> >&) (allocated_ptr.h:103)
==6205==    by 0x6A1A7EB: std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<nfd::pit::Entry, std::allocator<nfd::pit::Entry>, ndn::Interest const&>(std::_Sp_make_shared_tag, nfd::pit::Entry*, std::allocator<nfd::pit::Entry> const&, ndn::Interest const&) (shared_ptr_base.h:613)
==6205==    by 0x6A1A725: std::__shared_ptr<nfd::pit::Entry, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<nfd::pit::Entry>, ndn::Interest const&>(std::_Sp_make_shared_tag, std::allocator<nfd::pit::Entry> const&, ndn::Interest const&) (shared_ptr_base.h:1100)
==6205==    by 0x6A1A697: std::shared_ptr<nfd::pit::Entry>::shared_ptr<std::allocator<nfd::pit::Entry>, ndn::Interest const&>(std::_Sp_make_shared_tag, std::allocator<nfd::pit::Entry> const&, ndn::Interest const&) (shared_ptr.h:319)
==6205==    by 0x6A1A613: std::shared_ptr<nfd::pit::Entry> std::allocate_shared<nfd::pit::Entry, std::allocator<nfd::pit::Entry>, ndn::Interest const&>(std::allocator<nfd::pit::Entry> const&, ndn::Interest const&) (shared_ptr.h:620)
==6205==    by 0x6A1A4A7: std::shared_ptr<nfd::pit::Entry> std::make_shared<nfd::pit::Entry, ndn::Interest const&>(ndn::Interest const&) (shared_ptr.h:636)
==6205==    by 0x6A19742: nfd::pit::Pit::findOrInsert(ndn::Interest const&, bool) (pit.cpp:81)
==6205==    by 0x697469B: nfd::pit::Pit::insert(ndn::Interest const&) (pit.hpp:78)
==6205==    by 0x696BFCB: nfd::Forwarder::onIncomingInterest(nfd::face::Face&, ndn::Interest const&) (forwarder.cpp:147)
==6205== 
==6205== LEAK SUMMARY:
==6205==    definitely lost: 1,360 bytes in 8 blocks
==6205==    indirectly lost: 12,083 bytes in 210 blocks
==6205==      possibly lost: 0 bytes in 0 blocks
==6205==    still reachable: 520 bytes in 8 blocks
==6205==         suppressed: 0 bytes in 0 blocks
==6205== Reachable blocks (those to which a pointer was found) are not shown.
==6205== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==6205== 
==6205== For counts of detected and suppressed errors, rerun with: -v
==6205== ERROR SUMMARY: 3 errors from 3 contexts (suppressed: 0 from 0)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20170721/81be3b5e/attachment.html>


More information about the ndnSIM mailing list