Actions
Bug #3236
closedPriorityFifoPolicy memory leak
Start date:
10/03/2015
Due date:
% Done:
100%
Estimated time:
Description
nfd::cs::priority_fifo::PriorityFifoPolicy::attachQueue
has a memory leak.
Steps to reproduce:
- start NFD in valgrind with
--leak-check=full
, wait for initialization procedure to complete - start
ndnpingserver /A
- start
ndnping -i 10 /A
, wait 5 minutes - stop NFD by CTRL+C
Valgrind reports:
==12466== 1,963,504 (857,344 direct, 1,106,160 indirect) bytes in 26,792 blocks are definitely lost in loss record 379 of 379
==12466== at 0x4C2B0E0: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==12466== by 0x4C4E1A: nfd::cs::priority_fifo::PriorityFifoPolicy::attachQueue(std::_Rb_tree_const_iterator<nfd::cs::EntryImpl>) (cs-policy-priority-fifo.cpp:104)
==12466== by 0x4C512A: nfd::cs::priority_fifo::PriorityFifoPolicy::doAfterInsert(std::_Rb_tree_const_iterator<nfd::cs::EntryImpl>) (cs-policy-priority-fifo.cpp:44)
==12466== by 0x4C5E41: nfd::cs::Policy::afterInsert(std::_Rb_tree_const_iterator<nfd::cs::EntryImpl>) (cs-policy.cpp:54)
==12466== by 0x4C6823: nfd::cs::Cs::insert(ndn::Data const&, bool) (cs.cpp:113)
==12466== by 0x48C131: nfd::Forwarder::onIncomingData(nfd::Face&, ndn::Data const&) (forwarder.cpp:395)
==12466== by 0x48C66C: nfd::Forwarder::startProcessData(nfd::Face&, ndn::Data const&) (forwarder.cpp:79)
==12466== by 0x488214: std::_Function_handler<void (ndn::Data const&), std::_Bind<std::_Mem_fn<void (nfd::Forwarder::*)(nfd::Face&, ndn::Data const&)> (nfd::Forwarder*, std::reference_wrapper<nfd::Face>, std::_Placeholder<1>)> >::_M_invoke(std::_Any_data const&, ndn::Data const&) (functional:601)
==12466== by 0x449BD5: std::function<void (ndn::Data const&)>::operator()(ndn::Data const&) const (functional:2471)
==12466== by 0x4542BD: ndn::util::signal::Signal<nfd::Face, ndn::Data>::operator()(ndn::Data const&) (signal-signal.hpp:241)
==12466== by 0x452F16: nfd::face::LpFaceWrapper::dispatchData(ndn::Data const&) (signal-signal.hpp:255)
==12466== by 0x454467: std::_Function_handler<void (ndn::Data const&), std::_Bind<std::_Mem_fn<void (nfd::face::LpFaceWrapper::*)(ndn::Data const&)> (nfd::face::LpFaceWrapper*, std::_Placeholder<1>)> >::_M_invoke(std::_Any_data const&, ndn::Data const&) (functional:601)
PriorityFifoPolicy::attachQueue
allocates an EntryInfo
object with new operator, but the PriorityFifoPolicy
never deallocates this object with the delete operator or through smart pointers.
Files
Actions