[AGENT++] Re: AGENTPP Digest, Vol 25, Issue 10

???163 touchzhao at 163.com
Mon Feb 13 10:54:53 CET 2006


Hi,

I am very sorry to submit the mail list with misdata.
The GenAddress does not cause memory leak or overwriting error.
I linked all programs, include the application and som tests with an
outdated
static lib that had copied to a public path but the makefile of SNMP++
did not update it.

I did make sure every subproject use the same compiler flags,
some code does not support -qheapdebug so I erased it from all subprojects.
But the program crashes as before and give no information. It just core
dump,
and dbx show that the crash point locate at:

(dbx) where
.() at 0xe088
msgqueue.memset(void*,int,unsigned long)(0x200cf798, 0x0, 0x2000), line 127
in "string.h"
CSNMPMessageQueue::HandleEvents(int,const fd_set&,const fd_set&,const
fd_set&)(this = 0x20cf44c8, maxfds = 9, readfds = &(...),  = &(...),  =
&(...)), line 468 in "msgqueue.cpp"
unnamed block in HandleEvents(int,const fd_set&,const fd_set&,const
fd_set&)(this = 0x20cf4438, maxfds = 9, readfds = &(...), writefds = &(...),
exceptfds = &(...)), line 183 in "eventlist.cpp"
unnamed block in HandleEvents(int,const fd_set&,const fd_set&,const
fd_set&)(this = 0x20cf4438, maxfds = 9, readfds = &(...), writefds = &(...),
exceptfds = &(...)), line 183 in "eventlist.cpp"
HandleEvents(int,const fd_set&,const fd_set&,const fd_set&)(this =
0x20cf4438, maxfds = 9, readfds = &(...), writefds = &(...), exceptfds =
&(...)), line 183 in "eventlist.cpp"
SNMPProcessPendingEvents()(this = 0x20cf4428), line 213 in
"eventlistholder.cpp"
SNMPProcessEvents(int)(this = 0x20cf4428, max_block_milliseconds = 1000),
line 266 in "eventlistholder.cpp"
SNMPBlockForResponse(unsigned long,Pdu&)(this = 0x20cf4428, req_id = 14489,
pdu = &(...)), line 161 in "eventlistholder.cpp"
snmp_engine(Pdu&,long,long,const
SnmpTarget&,void(*)(int,Snmp*,Pdu&,SnmpTarget&,void*),const void*,int)(this
= 0x20cf4228, pdu = &(...), non_reps = 0, max_reps = 0, target = &(...), cb
= (nil), cbd = (nil), fd = -1), line 1757 in "uxsnmp.cpp"
uxsnmp.get(Pdu&,const SnmpTarget&)(this = 0x20cf4228, pdu = &(...), target =
&(...)), line 992 in "uxsnmp.cpp"
SnmpGet::run()(this = 0x20cf3298), line 65 in "snmpget.cpp"
run()(0x20026e08), line 466 in "thread.cpp"
starter(void*)(0x20026e6c), line 265 in "thread.cpp"

All the crashes locates msgqueue.cpp:468 whose code is
"FD_ZERO(&snmp_writefds);",
whichever I call Snmp::get() or Snmp::get_next() like this:

if((m_nStatus = m_pTheSnmp->get(pdu, theTarget)) == SNMP_CLASS_SUCCESS)
{
...
}

while((m_nStatus = m_pTheSnmp->get_next(pdu, theTarget)) ==
SNMP_CLASS_SUCCESS)
{
...
}

m_pTheSnmp point to the thread dedicated object and is assured point to a
valid Snmp instance.
m_nStatus are the member of SnmpWalk or SnmpGet class that derived from
SnmpOperation that is subclass of Thread.
pdu and theTarget(of CTarget) are a local vars.
Each thread object runs independently and shares nothing.

> > 1546-525 Object 0x20108BD8 is invalid or a libc heap object at line 535
in
> > ../include/snmp_pp/address.h
> >
> >            1000be38 = __dt__10UdpAddressFv + 0x8C
> >            1000c9c4 = __dt__10GenAddressFv + 0xB0
> >            1000c70c = __dt__10SnmpTargetFv + 0x74
> >            1000c34c = __dt__7CTargetFv + 0xB4
> >            1000b9f0 = main + 0x938
>
> this whould indicate that the problem is only related to the GenAddress
> class.
>
> Can you do a new test with only the following code (enable the ctarget
> line if there is no error message):
>
> int main()
> {
>    UdpAddress udpaddr("127.0.0.1");
>    GenAddress genaddr(udpaddr);
>    //CTarget ctarget(udpaddr);
> }
>
> As you wrote that snmp++ is compiled with the same compiler flags: If
> you use a shared lib, check that this lib is also used at runtime.






More information about the AGENTPP mailing list