Hi,
 
I'm having some problems with a memory leak in my agent code - the
template for which generated using the mfd config.  I would appreciate
any help to solve this problem since its now becoming a serious issue
for me.
 
 
I have run the code through valgrind and observe the following during a
brief run:
 
==12187== 6,672 bytes in 12 blocks are definitely lost in loss record 83
of 83
==12187==    at 0x401EC3E: calloc (vg_replace_malloc.c:279)
==12187==    by 0x804B7A2: <table>_allocate_rowreq_ctx
(<table>_interface.c:402)
==12187==    by 0x8049EF0: <table>_loop_get_first
(<table>_data_access.c:213)
==12187==    by 0x804C222: _<table>_loop_get_first_wrapper
(<table>_interface.c:753)
==12187==    by 0x41FD660: _iterator_get (container_iterator.c:94)
==12187==    by 0x4185D1B: _data_lookup (table_container.c:532)
==12187==    by 0x418580A: _container_table_handler
(table_container.c:622)
==12187==    by 0x41545AF: netsnmp_call_handler (agent_handler.c:428)
==12187==    by 0x4155BC1: netsnmp_call_next_handler
(agent_handler.c:533)
==12187==    by 0x418C6E2: table_helper_handler (table.c:618)

 
I've performed some debug to try and help understand what is happening
and found the following:
 - The "get_first" function is called which calls the
"allocate_rowreq_ctx" function.
 - A new rowreq_ctx is allocated.
 - The loop_save_position function is called which also allocates a new
rowreq_ctx
 - Once the get has been made the rowreq_ctx allocated during the
loop_save_position is freed
 - The initial rowreq_ctx never seems to get freed (at least not through
the interface call <table>_release_rowreq_ctx) - I added a reference
counter into the allocate_rowreq_ctx and release_rowreq_ctx and the
counter just keeps increasing.
 
 
Any help would be much appreciated - I'm of course happy to help do any
debugging, provide code extracts etc. to try and find the cause of the
problem.
I've tried several versions of Net-SNMP and found the same problem in
each one - including the 5.4.1-pre3.
 
Cheers
Graeme Wilson
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to