[AGENT++] memory limitation (crashes)

Jacquemin, Jean-Philippe jean-philippe.jacquemin at barco.com
Thu Jan 10 15:05:37 CET 2008


Hi Frank,

Thanks for your quick reply. Here are my answers:

>I would guess that it is a race condition.
>How do you synchronize the update thread with the AGENT++ thread pool
(requests)?

There is no sychronization used, only local database protection with
mutexes. The update thread reads out the available information from the
local database even if it is outdated and will be updated in 1s (the
update thread only waits on the mutex if it is held at the moment of an
update).
We were using SystemV semaphores (for IPC) that was later changed to
pthread_mutex, but this does not make any difference in behaviour (and
crash occurence).


> > (1) Could it really be a stack overflow ?? Has someone ever 
> > experienced it? How to get further information ?

> Use core dump to verify it.

Here is such a core dump from a crash: 

#0  0x400a9571 in kill () from
/mind/barco-dimm386i-bin/image/image/lib/libc.so.6
#1  0x4001cef1 in pthread_kill () from
/mind/barco-dimm386i-bin/image/image/lib/libpthread.so.0
#2  0x4001d371 in raise () from
/mind/barco-dimm386i-bin/image/image/lib/libpthread.so.0
#3  0x400aa83c in abort () from
/mind/barco-dimm386i-bin/image/image/lib/libc.so.6
#4  0x4004be14 in __default_terminate () from
/mind/barco-dimm386i-bin/image/image/lib/libstdc++-libc6.1-2.so.3
#5  0x4004be31 in __terminate () from
/mind/barco-dimm386i-bin/image/image/lib/libstdc++-libc6.1-2.so.3
#6  0x0811a294 in __pure_virtual ()
#7  0x0812611d in Vb::set_value (this=0xbf7ff850, val=@0x40401f38) at
../../../snmp++/include/snmp_pp/vb.h:165
#8  0x0806fa4f in Agentpp::MibLeaf::get_value (this=0x81e8ce0) at
mib.cpp:341
#9  0x0806fe52 in Agentpp::MibLeaf::get_request (this=0x81e8ce0,
req=0x404027b8, ind=0) at mib.cpp:395
#10 0x0806ff41 in Agentpp::MibLeaf::get_next_request (this=0x81e8ce0,
req=0x404027b8, ind=0) at mib.cpp:408
#11 0x0807f744 in Agentpp::Mib::process_request (this=0x81e2830,
req=0x404027b8, reqind=0) at mib.cpp:3371
#12 0x08080b71 in Agentpp::Mib::do_process_request (this=0x81e2830,
req=0x404027b8) at mib.cpp:3558
#13 0x08086297 in Agentpp::MibTask::run (this=0x404005a0) at
threads.cpp:954
#14 0x0808553d in Agentpp::TaskManager::run (this=0x81e31d8) at
threads.cpp:776
#15 0x080842ed in Agentpp::thread_starter (t=0x81e3200) at
threads.cpp:485
#16 0x4001ac67 in pthread_detach () from
/mind/barco-dimm386i-bin/image/image/lib/libpthread.so.0
#17 0x40126fda in clone () from
/mind/barco-dimm386i-bin/image/image/lib/libc.so.6


> > (4) Why is MAX_SNMP_PACKET defined as 2048 in SNMP++ redefined as
4096 
> > in AGENT++ ?

> Both should be the same (AGENT++ uses SNMP++ definition).
> Please upgrade to the latest version, if you have problems with that.

I did upgrade both to the latest release some time ago already but this
did not help. Still the same crashes!


However I just found that the ThreadPool uses  the parameter
AGENTPP_DEFAULT_STACKSIZE (put to 64kB). Can this be adjuted to fit
particular needs ?



-----Original Message-----
From: Frank Fock [mailto:fock at agentpp.com] 
Sent: donderdag 10 januari 2008 1:03
To: Jacquemin, Jean-Philippe
Cc: agentpp at agentpp.org
Subject: Re: [AGENT++] memory limitation (crashes)

Hi Jean-Philippe,

I do not think that it is a stack overflow, but that should be easy to
verify by a stack dump.

I would guess that it is a race condition.
How do you synchronize the update thread with the AGENT++ thread pool
(requests)?

More comments inline below:

Jacquemin, Jean-Philippe wrote:
> 
> The questions are:
> (1) Could it really be a stack overflow ?? Has someone ever 
> experienced it? How to get further information ?

Use core dump to verify it.

> (2) How to reduce the amount of memory used ?

Undef logging. As last resort, use virtual tables instead of MibTable
(thus use MibComplexEntry instead of MibTable).

> (3) Would it be useful to try and adjust the parameter MAX_SNMP_PACKET

> (currently at 4096) ?

I do not think so.

> (4) Why is MAX_SNMP_PACKET defined as 2048 in SNMP++ redefined as 4096

> in AGENT++ ?

Both should be the same (AGENT++ uses SNMP++ definition).
Please upgrade to the latest version, if you have problems with that.

> (5) Are there other parameters that may influence the memory footprint
?
>  
The default PDU size (number of allowed variables).

Best regards,
Frank

-- 
AGENT++
http://www.agentpp.com
http://www.mibexplorer.com
http://www.mibdesigner.com



DISCLAIMER:
Unless indicated otherwise, the information contained in this message is privileged and confidential, and is intended only for the use of the addressee(s) named above and others who have been specifically authorized to receive it. If you are not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this message and/or attachments is strictly prohibited. The company accepts no liability for any damage caused by any virus transmitted by this email. Furthermore, the company does not warrant a proper and complete transmission of this information, nor does it accept liability for any delays. If you have received this message in error, please contact the sender and delete the message. Thank you.



More information about the AGENTPP mailing list