I tried running "top" while servicing SNMPv3 "get" requests.  Results:

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 3585 root      20   0 13168 2988 1008 S  0.0  0.1   0:00.05 snmpd
 3585 root      20   0 13168 2988 1008 S  0.0  0.1   0:00.05 snmpd
 3585 root      20   0 13168 2988 1008 S  0.0  0.1   0:00.05 snmpd
 3585 root      20   0 13168 3220 1240 S  0.3  0.2   0:00.06 snmpd
 3585 root      20   0 13168 3220 1240 S  0.3  0.2   0:00.07 snmpd
 3585 root      20   0 13168 3220 1240 S  0.0  0.2   0:00.07 snmpd
...
 3585 root      20   0 13168 3220 1240 S  0.0  0.2   0:00.18 snmpd
 3585 root      20   0 13168 3220 1240 S  0.0  0.2   0:00.18 snmpd
 3585 root      20   0 13168 3220 1240 S  0.0  0.2   0:00.18 snmpd
 3585 root      20   0 13168 3224 1244 S  0.0  0.2   0:00.18 snmpd
 3585 root      20   0 13168 3224 1244 S  0.3  0.2   0:00.19 snmpd
 3585 root      20   0 13168 3224 1244 S  0.3  0.2   0:00.20 snmpd

The first jump of memory usage was when I first started querying the agent
with a given SNMPv3 user.  The second, smaller jump happened when I
switched to querying an object served by a subagent.  This is many
queries/second, so it seems like the leak is at least not per-request.

I haven't had a chance to run valgrind to see what it thinks.  Have you
found a way to cause multiple leaks?

  Bill


On Tue, Jul 8, 2014 at 2:19 PM, Sean Burke <sean.bu...@pacbell.net> wrote:

> I've observed the leak with GET and v3 AuthNoPriv. I believe
> that GET-NEXT and GET-BULK would show the problem also.
> I am running an agent session that receives these requests.
>
> -SEan
>
>
>
> On Jul 8, 2014, at 11:10 AM, Bill Fenner wrote:
>
> On Tue, Jun 24, 2014 at 3:47 AM, Sean Burke <sean.bu...@pacbell.net>
> wrote:
>
>> Hi All,
>>
>> I am writing to ask about this code in 5.7.2.1 snmp_api.c at line 5423.
>> I am specifically concerned with the constraint pdu->command ==
>> SNMP_MSG_TRAP2,
>> which appears to interfere with freeing the securityStateRef for request
>> command
>> types, e.g. GET, SET, GET-NEXT, GET-BULK.
>>
>> Testing with valgrind indicates that removing the pdu-command constraint
>> fixes a leak.
>> Is this an error, or is there a rationale that I do not understand?
>>
>> Thanks,
>> -SEan
>>
>>   /*
>>
>>
>>
>>
>>    * Call USM to free any securityStateRef supplied with the message.
>>
>>
>>
>>
>>    */
>>   if (pdu != NULL && pdu->securityStateRef &&
>>       pdu->command == SNMP_MSG_TRAP2) {
>>     sptr = find_sec_mod(pdu->securityModel);
>>     if (sptr) {
>>       if (sptr->pdu_free_state_ref) {
>>         (*sptr->pdu_free_state_ref) (pdu->securityStateRef);
>>       } else {
>>         snmp_log(LOG_ERR,
>>                  "Security Model %d can't free state references\n",
>>                  pdu->securityModel);
>>       }
>>     } else {
>>       snmp_log(LOG_ERR,
>>                "Can't find security model to free ptr: %d\n",
>>                pdu->securityModel);
>>     }
>>     pdu->securityStateRef = NULL;
>>   }
>>
>>
> Can you say what operation you perform to cause this leak?  (E.g.,
> authPriv SNMPv3 GET?)
>
>   Bill
>
>
>
------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to