RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1794168 - net-snmp memory leak
Summary: net-snmp memory leak
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: net-snmp
Version: 7.7
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: rc
: ---
Assignee: Josef Ridky
QA Contact: Evgeny Fedin
URL:
Whiteboard:
Depends On:
Blocks: 1780582 1832223 1832224
TreeView+ depends on / blocked
 
Reported: 2020-01-22 19:58 UTC by bofo13
Modified: 2023-12-15 17:13 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1832223 1832224 (view as bug list)
Environment:
Last Closed: 2020-09-29 20:56:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2020:4037 0 None None None 2020-09-29 20:56:49 UTC

Description bofo13 2020-01-22 19:58:32 UTC
Hi,
snmpd process from net-snmp gets bigger and bigger while it is requested.
Especially when using SNMPv3, SHA and AES.
On some servers process was using more than 500MB of memory, had to restart it to come back to the usual 10MB.
But process then grows again.
Could you look at this please ?
Thank you very much !

# uname -r
3.10.0-1062.9.1.el7.x86_64
# cat /etc/centos-release
CentOS Linux release 7.7.1908 (Core)
# yum list installed | grep snmp
net-snmp.x86_64 1:5.7.2-43.el7 @base
net-snmp-agent-libs.x86_64 1:5.7.2-43.el7 @base
net-snmp-libs.x86_64 1:5.7.2-43.el7 @base
net-snmp-perl.x86_64 1:5.7.2-43.el7 @base
net-snmp-utils.x86_64 1:5.7.2-43.el7 @base

Initial report : https://bugs.centos.org/view.php?id=16927

Comment 2 bofo13 2020-01-22 20:00:34 UTC
Some kind related to bug #1779609.

Comment 3 Josef Ridky 2020-01-23 07:48:16 UTC
Bug #1779609 is about sth else, but I'll try to take a look at it.

Do you have any reproducer (e.g. content of /etc/snmp/snmpd.conf, used commands for running snmp queries and so on)?

Comment 4 bofo13 2020-01-23 10:59:54 UTC
Thank you Josef for your answer.

Here's the daemon config :

# grep -vE '^#.*|^$' /etc/snmp/snmpd.conf 
rouser r
syslocation Unknown (edit /etc/snmp/snmpd.conf)
syscontact Root <root@localhost> (configure /etc/snmp/snmp.local.conf)
dontLogTCPWrappersConnects yes
agentAddress udp:161
includeAllDisks 0
extend-sh testcmd echo OK

# grep -vE '^#.*|^$' /var/lib/net-snmp/snmpd.conf 
usmUser 1 3 0x80001f8880cf894745b6369a5c00000000 "r" "r" NULL .1.3.6.1.6.3.10.1.1.3 0x4cd9dcb044a50668ebb54f73e81cf10ce41e77b1 .1.3.6.1.6.3.10.1.2.4 0x4cd9dcb044a50668ebb54f73e81cf10c 0x
ifXTable .1 14:0 18:0x $
ifXTable .2 14:0 18:0x $
setserialno 1840552802
engineBoots 47
oldEngineID 0x80001f8880cf894745b6369a5c00000000

Command used to create the above user :
createUser r SHA "MyNicePassword" AES "MyNicePassword"

I request the following OID every minute :
.1.3.6.1.2.1.25.3.3.1.2

And the following ones on a 3 minutes basis :
.1.3.6.1.4.1.2021.9.1
.1.3.6.1.2.1.25.4.2.1
.1.3.6.1.4.1.2021.4.3 / .1.3.6.1.4.1.2021.4.4
.1.3.6.1.2.1.25.1.1
.1.3.6.1.2.1.25.1.2

I don't know if it's related to a particular OID, or if it's a SNMP v3 / SHA / AES issue.
I would go for a SNMP v3 / SHA / AES issue, because using the exact same configuration with SNMP v2 does not trigger the issue.

May perhaps help, note that using the exact same configuration (OID, SNMP v3 / SHA / AES) on Debian 9/10 does not trigger the issue.

Feel free if needed, thank you !

Comment 5 Ties Voskamp 2020-01-25 12:59:30 UTC
Hi,

I can confirm this issue. I see the memory usage (memory_rss) grow with every request that is handled bij net-snmpd.
It doesn't matter if I use the standard SNMP-OID's or use "extend" or "extend-sh".

When downgrading to net-snmpd 5.7.2-37 this behaviour stops.

If you need additional info to debug just let me know!

Kind regards,
Ties Voskamp

Comment 6 Josef Ridky 2020-01-28 09:26:48 UTC
After some investigation, I have good news.

This issue has been fixed in version net-snmp-5.7.2-45, which will be available in RHEL-7.8 release, that should be released in Q1 2020.

Only obstacle for me is, I don't know exactly, how long does it take to propagate RHEL-7.8 repositories to CentOS, but it's not aim of this bug report.

Due of fix availablility, I am closing this bug report as NEXTRELEASE.

Comment 7 bofo13 2020-01-28 11:12:01 UTC
Really good news, thank you very much Josef.

Comment 35 errata-xmlrpc 2020-09-29 20:56:26 UTC
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 (net-snmp bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:4037


Note You need to log in before you can comment on or make changes to this bug.