Bug 421

Summary: Memory leak in csma-ping
Product: ns-3 Reporter: Craig Dowell <craigdo>
Component: samplesAssignee: ns-bugs <ns-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: mathieu.lacage
Priority: P5    
Version: ns-3-dev   
Hardware: All   
OS: All   

Description Craig Dowell 2008-11-25 23:07:53 UTC
Linux version 2.6.24-19-server (buildd@king) (gcc version 4.2.3 (Ubuntu 4.2.3-2ubuntu7)) #1 SMP Wed Aug 20 18:43:06 UTC 2008

gcc version 4.2.3 (Ubuntu 4.2.3-2ubuntu7)

[ns-regression] ~/repos/ns-3-dev > ./waf --run csma-ping --valgrind
Entering directory `/home/craigdo/repos/ns-3-dev/build'
Compilation finished successfully
==32308== Memcheck, a memory error detector.
==32308== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et al.
==32308== Using LibVEX rev 1804, a library for dynamic binary translation.
==32308== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP.
==32308== Using valgrind-3.3.0-Debian, a dynamic binary instrumentation framework.
==32308== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et al.
==32308== For more details, rerun with: -v
==32308==
==32308==
==32308== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 7 from 1)
==32308== malloc/free: in use at exit: 42,630 bytes in 141 blocks.
==32308== malloc/free: 5,075 allocs, 4,934 frees, 348,243 bytes allocated.
==32308== For counts of detected errors, rerun with: -v
==32308== searching for pointers to 141 not-freed blocks.
==32308== checked 850,720 bytes.
==32308==
==32308== 40,926 (312 direct, 40,614 indirect) bytes in 3 blocks are definitely lost in loss record 35 of 46
==32308==    at 0x4C23809: operator new(unsigned long) (vg_replace_malloc.c:230)
==32308==    by 0x535FFE2: ns3::Ptr<ns3::Node> ns3::CreateObject<ns3::Node>(ns3::AttributeList const&) (object.h:398)
==32308==    by 0x5360712: ns3::Ptr<ns3::Node> ns3::CreateObject<ns3::Node>(std::string, ns3::AttributeValue const&, std::string
, ns3::AttributeValue const&, std::string, ns3::AttributeValue const&, std::string, ns3::AttributeValue const&, std::string, ns3
::AttributeValue const&, std::string, ns3::AttributeValue const&, std::string, ns3::AttributeValue const&, std::string, ns3::Att
ributeValue const&, std::string, ns3::AttributeValue const&) (object.h:463)
==32308==    by 0x54E1F67: ns3::NodeContainer::Create(unsigned) (node-container.cc:79)
==32308==    by 0x4074D2: main (csma-ping.cc:70)
==32308==
==32308== LEAK SUMMARY:
==32308==    definitely lost: 312 bytes in 3 blocks.
==32308==    indirectly lost: 40,614 bytes in 135 blocks.
==32308==      possibly lost: 0 bytes in 0 blocks.
==32308==    still reachable: 1,704 bytes in 3 blocks.
==32308==         suppressed: 0 bytes in 0 blocks.
==32308== Reachable blocks (those to which a pointer was found) are not shown.
==32308== To see them, rerun with: --leak-check=full --show-reachable=yes
[ns-regression] ~/repos/ns-3-dev >
Comment 1 Mathieu Lacage 2008-11-26 07:24:32 UTC
changeset 76fabfcfd757