Hide Forgot
+++ This bug was initially created as a clone of Bug #676955 +++ Description of problem: The NetSNMP::TrapReceiver Perl module distributed in the net-snmp-perl package leaks memory when it is used to register an SNMP trap handler with the snmptrapd process. Version-Release number of selected component (if applicable): net-snmp-perl 5.3.2.2-9.el5_5.1 NetSNMP::TrapReceiver 5.03022 How reproducible: Every time. Steps to Reproduce: 1. Create a no-op Perl trap handler with this code: #!/usr/bin/perl use SNMP; sub my_receiver {} NetSNMP::TrapReceiver::register("all", \&my_receiver) or warn "Failed to register Perl trap handler\n"; print "Registered Perl trap handler\n"; 2. Configure snmptrapd using this line in /etc/snmp/snmptrapd.conf: perl do "/path/to/subagent"; 3. Run snmptrapd with valgrind's memcheck tool: valgrind -v --leak-check=yes /usr/sbin/snmptrapd -Lsd -p /var/run/snmptrapd.pid -f 4. When the "Registered Perl trap handler" message appears, send one or more traps to the server. 5. Quit valgrind and snmptrapd with ctrl-c. This will display the memcheck report. Actual results: snmptrapd leaks memory. This is amplified the more traps are sent to the receiver. Eventually, on a busy server, snmptrapd consumes all available memory on the system. Expected results: snmptrapd runs memcheck-clean (does not leak memory). Remove the "perl do" line from /etc/snmp/snmptrapd.conf and run the valgrind command in step 3 again and the result will be memcheck-clean.
The leak appears only when processing V1 traps and it has been fixed upstream: http://net-snmp.svn.sourceforge.net/viewvc/net-snmp?view=revision&revision=19335
Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: The previous version of snmptrapd, the Net-SNMP daemon for processing traps, leaked memory when processing incoming SNMP traps in embedded Perl. This caused the amount of consumed memory to grow over time, making the memory consumption was even larger if the daemon was processing SNMPv1 traps. With this update, the underlying source code has been adapted to prevent such memory leaks, and processing incoming SNMP traps in embedded Perl no longer increases the memory consumption. (BZ#678314).
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2011-1524.html
Hi, I have tried with all the versions of net-snmp from net-snmp-5.4 till net-snmp-5.7.2 and I still see the memory leak issue for V1 traps. My CPU usage goes quite high with %MEM keeps getting accumulated. Below are the statistics - %CPU Usage - 56.0 %MEM - 8.1 VIRT - 811m RES - 637m SHR - 2124 Can you please confirm if this issue has been truly fixed? If so, what is the correct resolution? Thanks, Vineela
(In reply to vineela048 from comment #8) > Hi, > > I have tried with all the versions of net-snmp from net-snmp-5.4 till > net-snmp-5.7.2 and I still see the memory leak issue for V1 traps. My CPU > usage goes quite high with %MEM keeps getting accumulated. > > Below are the statistics - > > %CPU Usage - 56.0 > %MEM - 8.1 > VIRT - 811m > RES - 637m > SHR - 2124 > > Can you please confirm if this issue has been truly fixed? If so, what is The issue described in this bug has been truly fixed, tested today with net-snmp-5.5-49.el6.x86_64. Maybe you experience some other leak or bug. Please keep in mind that bugzilla is not a support tool or means of accessing support. If you would like technical support please visit our support portal at access.redhat.com or