|
From: Keita R. <KX...@bh...> - 2007-02-02 11:10:38
|
I am running ns-2 and am trying to use valgrind to locate memory leaks = that I suspect may have cause a termination. The results produced by = valgrind seem a bit difficult to interpret however. This is what = valgrind had produced =3D=3D6032=3D=3D Memcheck, a memory error detector. =3D=3D6032=3D=3D Copyright (C) 2002-2007, and GNU GPL'd, by Julian = Seward et al. =3D=3D6032=3D=3D Using LibVEX rev 1715, a library for dynamic binary = translation. =3D=3D6032=3D=3D Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks = LLP. =3D=3D6032=3D=3D Using valgrind-3.2.2, a dynamic binary instrumentation = framework. =3D=3D6032=3D=3D Copyright (C) 2000-2007, and GNU GPL'd, by Julian = Seward et al. =3D=3D6032=3D=3D For more details, rerun with: -v =3D=3D6032=3D=3D=20 =3D=3D6032=3D=3D My PID =3D 6032, parent PID =3D 5998. Prog and args = are: =3D=3D6032=3D=3D ns =3D=3D6032=3D=3D wireless36-20-1-R3.tcl =3D=3D6032=3D=3D=20 =3D=3D6032=3D=3D Mismatched free() / delete / delete [] =3D=3D6032=3D=3D at 0x4005679: operator delete(void*) = (vg_replace_malloc.c:244) =3D=3D6032=3D=3D by 0x8145D01: RoutingTable::AddEntry(rtable_ent = const&) (in /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x8143BAB: DSDV_Agent::updateRoute(rtable_ent*, = rtable_ent*) (in /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x8143F5A: DSDV_Agent::processUpdate(Packet*) (in = /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x8144A86: DSDV_Agent::recv(Packet*, Handler*) = (in /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x805E702: Classifier::recv(Packet*, Handler*) = (in /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x8056062: NsObject::handle(Event*) (in = /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x8053082: Scheduler::dispatch(Event*, double) = (in /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x8052FE8: Scheduler::run() (in = /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x8053180: Scheduler::command(int, char const* = const*) (in /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x824E03D: TclClass::dispatch_cmd(void*, = Tcl_Interp*, int, char const**) (in /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x82519C5: OTclDispatch (otcl.c:434) =3D=3D6032=3D=3D Address 0x64E62B8 is 0 bytes inside a block of size = 680 alloc'd =3D=3D6032=3D=3D at 0x4005039: operator new[](unsigned) = (vg_replace_malloc.c:195) =3D=3D6032=3D=3D by 0x8145AF1: RoutingTable::RoutingTable() (in = /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x8144F35: DSDV_Agent::DSDV_Agent() (in = /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x814597D: DSDVClass::create(int, char const* = const*) (in /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x824E067: TclClass::create_shadow(void*, = Tcl_Interp*, int, char const**) (in /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x82519C5: OTclDispatch (otcl.c:434) =3D=3D6032=3D=3D by 0x82562A2: TclInvokeStringCommand (in = /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x8257174: TclEvalObjvInternal (in = /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x8278EC4: TclExecuteByteCode (in = /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x8278324: TclCompEvalObj (in = /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x8279158: TclExecuteByteCode (in = /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x8278324: TclCompEvalObj (in = /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D=20 =3D=3D6032=3D=3D Mismatched free() / delete / delete [] =3D=3D6032=3D=3D at 0x4005679: operator delete(void*) = (vg_replace_malloc.c:244) =3D=3D6032=3D=3D by 0x8145D01: RoutingTable::AddEntry(rtable_ent = const&) (in /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x81447C6: DSDV_Agent::forwardPacket(Packet*) (in = /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x8144B0B: DSDV_Agent::recv(Packet*, Handler*) = (in /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x805E702: Classifier::recv(Packet*, Handler*) = (in /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x8065069: Agent::send(Packet*, Handler*) (in = /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x8084DF7: RCUBEMHAgent::reg() (in = /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x8084880: RCUBEMHAgent::recv(Packet*, Handler*) = (in /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x805E702: Classifier::recv(Packet*, Handler*) = (in /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x8144AF8: DSDV_Agent::recv(Packet*, Handler*) = (in /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x805E702: Classifier::recv(Packet*, Handler*) = (in /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x8056062: NsObject::handle(Event*) (in = /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D Address 0x552EAB8 is 0 bytes inside a block of size = 680 alloc'd =3D=3D6032=3D=3D at 0x4005039: operator new[](unsigned) = (vg_replace_malloc.c:195) =3D=3D6032=3D=3D by 0x8145AF1: RoutingTable::RoutingTable() (in = /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x8144F35: DSDV_Agent::DSDV_Agent() (in = /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x814597D: DSDVClass::create(int, char const* = const*) (in /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x824E067: TclClass::create_shadow(void*, = Tcl_Interp*, int, char const**) (in /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x82519C5: OTclDispatch (otcl.c:434) =3D=3D6032=3D=3D by 0x82562A2: TclInvokeStringCommand (in = /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x8257174: TclEvalObjvInternal (in = /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x8278EC4: TclExecuteByteCode (in = /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x8278324: TclCompEvalObj (in = /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x8279158: TclExecuteByteCode (in = /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x8278324: TclCompEvalObj (in = /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D=20 =3D=3D6032=3D=3D Mismatched free() / delete / delete [] =3D=3D6032=3D=3D at 0x4005679: operator delete(void*) = (vg_replace_malloc.c:244) =3D=3D6032=3D=3D by 0x8145D01: RoutingTable::AddEntry(rtable_ent = const&) (in /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x8143BAB: DSDV_Agent::updateRoute(rtable_ent*, = rtable_ent*) (in /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x81442CD: DSDV_Agent::processUpdate(Packet*) (in = /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x8144A86: DSDV_Agent::recv(Packet*, Handler*) = (in /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x805E702: Classifier::recv(Packet*, Handler*) = (in /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x8056062: NsObject::handle(Event*) (in = /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x8053082: Scheduler::dispatch(Event*, double) = (in /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x8052FE8: Scheduler::run() (in = /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x8053180: Scheduler::command(int, char const* = const*) (in /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x824E03D: TclClass::dispatch_cmd(void*, = Tcl_Interp*, int, char const**) (in /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x82519C5: OTclDispatch (otcl.c:434) =3D=3D6032=3D=3D Address 0x74C55D8 is 0 bytes inside a block of size = 680 alloc'd =3D=3D6032=3D=3D at 0x4005039: operator new[](unsigned) = (vg_replace_malloc.c:195) =3D=3D6032=3D=3D by 0x8145AF1: RoutingTable::RoutingTable() (in = /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x8144F35: DSDV_Agent::DSDV_Agent() (in = /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x814597D: DSDVClass::create(int, char const* = const*) (in /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x824E067: TclClass::create_shadow(void*, = Tcl_Interp*, int, char const**) (in /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x82519C5: OTclDispatch (otcl.c:434) =3D=3D6032=3D=3D by 0x82562A2: TclInvokeStringCommand (in = /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x8257174: TclEvalObjvInternal (in = /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x8278EC4: TclExecuteByteCode (in = /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x8278324: TclCompEvalObj (in = /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x8279158: TclExecuteByteCode (in = /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x8278324: TclCompEvalObj (in = /root/ns-allinone-2.29/ns-2.29/ns) valgrind: m_signals.c:1463 (async_signalhandler): Assertion 'tst->status = =3D=3D VgTs_WaitSys' failed. =3D=3D6032=3D=3D at 0x38012EFE: report_and_quit (m_libcassert.c:136) =3D=3D6032=3D=3D by 0x38013088: vgPlain_assert_fail = (m_libcassert.c:200) =3D=3D6032=3D=3D by 0x3801E635: async_signalhandler = (m_signals.c:1463) =3D=3D6032=3D=3D by 0x3801D159: calculate_SKSS_from_SCSS = (m_signals.c:459) sched status: running_tid=3D1 Thread 1: status =3D VgTs_Runnable =3D=3D6032=3D=3D at 0x807AFB1: list_access(List*, int) (in = /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x807F68F: R3_RouteLogic::R3_position(int, int) = (in /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x8082B5D: R3HashClassifier::lookup(Packet*) (in = /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x80822FE: R3HashClassifier::classify(Packet*) = (in /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x805E729: Classifier::find(Packet*) (in = /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x808257A: R3HashClassifier::recv(Packet*, = Handler*) (in /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x8056062: NsObject::handle(Event*) (in = /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x8053082: Scheduler::dispatch(Event*, double) = (in /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x8052FE8: Scheduler::run() (in = /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x8053180: Scheduler::command(int, char const* = const*) (in /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x824E03D: TclClass::dispatch_cmd(void*, = Tcl_Interp*, int, char const**) (in /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x82519C5: OTclDispatch (otcl.c:434) =3D=3D6032=3D=3D by 0x82562A2: TclInvokeStringCommand (in = /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x8257174: TclEvalObjvInternal (in = /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x8278EC4: TclExecuteByteCode (in = /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x8278324: TclCompEvalObj (in = /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x8279158: TclExecuteByteCode (in = /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x8278324: TclCompEvalObj (in = /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x82A2A93: TclObjInterpProc (in = /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x82A2612: TclProcInterpProc (in = /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x8251B5D: OTclDispatch (otcl.c:477) =3D=3D6032=3D=3D by 0x82562A2: TclInvokeStringCommand (in = /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x8257174: TclEvalObjvInternal (in = /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x8278EC4: TclExecuteByteCode (in = /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x8278324: TclCompEvalObj (in = /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x82A2A93: TclObjInterpProc (in = /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x82A2612: TclProcInterpProc (in = /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x82519C5: OTclDispatch (otcl.c:434) =3D=3D6032=3D=3D by 0x82562A2: TclInvokeStringCommand (in = /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x8257174: TclEvalObjvInternal (in = /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x8257BF1: Tcl_EvalEx (in = /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x8290FC5: Tcl_FSEvalFile (in = /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x829723D: Tcl_Main (in = /root/ns-allinone-2.29/ns-2.29/ns) =3D=3D6032=3D=3D by 0x804CCAE: main (in = /root/ns-allinone-2.29/ns-2.29/ns) Note: see also the FAQ.txt in the source distribution. It contains workarounds to several common problems. If that doesn't help, please report this bug to: www.valgrind.org In the bug report, send all the above text, the valgrind version, and what Linux distro you are using. Thanks. Any help in the interpretation of this would be greatly appreciated. Thank you Keita |
|
From: Paul P. <ppl...@gm...> - 2007-02-03 03:44:36
|
Keita Rose wrote:
>I am running ns-2 and am trying to use valgrind to locate memory leaks that I suspect may have cause a termination. The results produced by valgrind seem a bit difficult to interpret however.
>
It's not clear what your difficulty is.
The first 3 messages tell you that you are doing this:
Class *c = new Class[34]; // RoutingTable ctor;
// can't tell what objects it actually
allocates
...
delete c; // RoutingTable::AddEntry()
The problem here is that 34 Class instances are constructed,
but only 1 instance is destroyed.
If Class itself contains dynamically allocated memory which
is supposed to be released in Class dtor, then that's the
source of your memory leak right there.
>
>valgrind: m_signals.c:1463 (async_signalhandler): Assertion 'tst->status == VgTs_WaitSys' failed.
>
The last one implies a bug in Valgrind (I think).
Cheers,
|