[prev in list] [next in list] [prev in thread] [next in thread] 

List:       net-snmp-bugs
Subject:    [ net-snmp-Bugs-702435 ] memory leak and wrong trap oid for agentx subagents
From:       "SourceForge.net" <noreply () sourceforge ! net>
Date:       2004-08-24 1:25:42
Message-ID: E1BzQ4E-0000R5-00 () sc8-sf-web3 ! sourceforge ! net
[Download RAW message or body]

Bugs item #702435, was opened at 2003-03-12 14:32
Message generated for change (Comment added) made by rstory
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=112694&aid=702435&group_id=12694

Category: agent
Group: agentx
Status: Open
Resolution: None
Priority: 7
Submitted By: Franz G. Fischer (franzfischer)
Assigned to: Nobody/Anonymous (nobody)
Summary: memory leak and wrong trap oid for agentx subagents

Initial Comment:
1. Memory leak in agentx subagent on SNMP SET
operations.
When performing a SNMP SET operation to a value backed
by an
agentx subagent, the subagent allocates memory which it
not freed.
The master agent shows no increase in virt. memory
size.

With tracing and compiling with dmalloc, the problem
could be
tracked down to handle_subagent_set_response() in
agentx/subagent.c
(missing snmp_free_varbind()) and to set_cache handling
in
module agent/snmp_agent.c.

Attached is a patch which fixes the memory leaks (at
least for me);
it has been tested on Linux/i386 and Digital UNIX
4.0d/alpha with
the old_api handler and the scalar instance handler.

2. When an agentx subagent sent an enterprise specific
trap
using send_enterprise_trap_vars(...), the trap includes
two instances
of sysUptime.0 and snmpTrapOID.0 and the net-snmp
enterprise
trap oid although another trap oid had been passed to
send_enterprise_trap_vars().  Note that the net-snmp
snmptrapd does
not show this in the normal log, but e.g. a simple
scotty-based trap
receiver does.

This problem can be solved by implementing the TODO in
convert_v2_to_v1(), which is called when the agentx
master forwards
the trap from the subagent with send_trap_vars(-1, -1,
pdu-&gt;variables), which in turn calls
send_enterprise_trap_vars() with the compiled in
enterprise trap oid.  Send_enterprise_trap_vars then
adds sysUptime.0
and smtpTrapOID.0 a second time and calls
convert_v2_to_v1(), which should remove the additional
info and restore the enterprise trap oid.

The attached patch fixes this problem, too --- at least
for me and I hope that it breaks no other things.

----------------------------------------------------------------------

>Comment By: Robert Story (rstory)
Date: 2004-08-23 21:25

Message:
Logged In: YES 
user_id=76148

Thanks for the patch. The memory leak portion of it has been
applied to the 5-0-patches, 5-1-patches and MAIN CVS
branches. The applied version of the  patch is at 

http://sourceforge.net/tracker/index.php?func=detail&aid=1014853&group_id=12694&atid=456380

Bug report left open until someone verifies that the trap
issue is solved as well.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=112694&aid=702435&group_id=12694


-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
Net-snmp-bugs mailing list
Net-snmp-bugs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-bugs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic