snmptrapd v5.4.1 seems to have a memory leak much like snmpd in the previous release

Bug #380942 reported by Luke J Militello
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
net-snmp (Ubuntu)
Confirmed
Low
Unassigned

Bug Description

I've ran some tests and snmptrapd in version 5.4.1 seems to be consuming system memory much like how snmpd had a memory leak in the previous release. I have been cron'ing this script every 15 minutes to justify my findings. I do a lot of trap catching so I'm not sure if that has any significance. I am running Ubuntu 8.04.2 (hardy) with kernel 2.6.24-24-sparc64-smp and I have 4GB of RAM.

#!/bin/bash
SHELL=/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
memoryUsage=`ps aux | grep "/usr/sbin/snmptrapd -Lsd -p /var/run/snmptrapd.pid" | grep -v "grep" | awk -F " " '{print $4}'`
dateTime=`date`
echo "SNMPTRAPD [$dateTime]: $memoryUsage% system memory used." >> /etc/snmp/snmptrapd.debug.dat
#eof

And the results are...

SNMPTRAPD [Wed May 13 00:00:01 EDT 2009]: 0.4% system memory used.
SNMPTRAPD [Wed May 13 00:15:01 EDT 2009]: 0.7% system memory used.
SNMPTRAPD [Wed May 13 00:30:01 EDT 2009]: 0.8% system memory used.
SNMPTRAPD [Wed May 13 00:45:01 EDT 2009]: 0.8% system memory used.
SNMPTRAPD [Wed May 13 01:00:01 EDT 2009]: 0.9% system memory used.
SNMPTRAPD [Wed May 13 01:15:02 EDT 2009]: 0.9% system memory used.
SNMPTRAPD [Wed May 13 01:30:01 EDT 2009]: 1.5% system memory used.
SNMPTRAPD [Wed May 13 01:45:01 EDT 2009]: 1.7% system memory used.
SNMPTRAPD [Wed May 13 02:00:01 EDT 2009]: 1.7% system memory used.
SNMPTRAPD [Wed May 13 02:15:01 EDT 2009]: 1.8% system memory used.
[...]
SNMPTRAPD [Wed May 27 06:45:02 EDT 2009]: 69.4% system memory used.
SNMPTRAPD [Wed May 27 07:00:01 EDT 2009]: 69.4% system memory used.
SNMPTRAPD [Wed May 27 07:15:01 EDT 2009]: 69.5% system memory used.
SNMPTRAPD [Wed May 27 07:30:01 EDT 2009]: 69.4% system memory used.
SNMPTRAPD [Wed May 27 07:45:01 EDT 2009]: 69.5% system memory used.
SNMPTRAPD [Wed May 27 08:00:01 EDT 2009]: 69.4% system memory used.
SNMPTRAPD [Wed May 27 08:15:01 EDT 2009]: 69.4% system memory used.
SNMPTRAPD [Wed May 27 08:30:01 EDT 2009]: 69.3% system memory used.
SNMPTRAPD [Wed May 27 08:45:01 EDT 2009]: 69.3% system memory used.
SNMPTRAPD [Wed May 27 09:00:01 EDT 2009]: 69.3% system memory used.

Complete output file is attached.

Revision history for this message
Luke J Militello (kilahurtz) wrote :
Revision history for this message
Chuck Short (zulcss) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. Please try to obtain a valgrind log following the instructions at https://wiki.ubuntu.com/Valgrind and attach the file to the bug report. This will greatly help us in tracking down your problem.

Changed in net-snmp (Ubuntu):
status: New → Incomplete
Revision history for this message
Luke J Militello (kilahurtz) wrote :

Tried to install Valgrind but it does not seem to exist in the repositories. And yes, they are up-2-date. Would this be in a specific repo?

Reading package lists... Done
Building dependency tree
Reading state information... Done
Package valgrind is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package valgrind has no installation candidate

Revision history for this message
Luke J Militello (kilahurtz) wrote :

Also, as a band-aid workaround, I have Cron restarting SNMP at midnight every night to combat this memory issue.

Revision history for this message
Luke J Militello (kilahurtz) wrote :

Gathering debug info...

Changed in net-snmp (Ubuntu):
status: Incomplete → In Progress
Revision history for this message
Luke J Militello (kilahurtz) wrote :

Doh, looks like valgrind is not pre-compiled for sparc architecture. Is there another alternative?

http://packages.ubuntu.com/hardy/valgrind

I suppose I could compile and install myself if needed.

Revision history for this message
Luke J Militello (kilahurtz) wrote :

Hmm...seems like I can't compile either...

checking for a supported CPU... no (sparc64)
configure: error: Unsupported host architecture. Sorry

Changed in net-snmp (Ubuntu):
status: In Progress → New
Chuck Short (zulcss)
Changed in net-snmp (Ubuntu):
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Luke J Militello (kilahurtz) wrote :

Is there anything else I can do to assist in isolating this issue?

Revision history for this message
Luke J Militello (kilahurtz) wrote :

Any word on this? Is there an alternative to valgrind that can be used on sparc?

Revision history for this message
Luke J Militello (kilahurtz) wrote :

Found this bug which was fixed in v5.4.2...

http://sourceforge.net/tracker/?func=detail&aid=1955227&group_id=12694&atid=112694

It might apply to this as my box in question is 64-bit also.

The current stable release of this train is v5.4.2.1...

http://www.net-snmp.org/download.html

Revision history for this message
Luke J Militello (kilahurtz) wrote :

Chuck, your thoughts on this? Am I on to anything here with my previous post?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.