Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
Created attachment 1627026[details]
Valgrind Test Result
Description of problem:
Using the valgrind 3.15.0 with our Manageability software observer the memory leak. We verified the on the SLSE15SP1 which also uses the liblua 5.3.5 has the same observation. No leakage observed on RHEL7 and SLES12SP4 which use liblua 5.1.5.
Version-Release number of selected component (if applicable):
How reproducible:
Manageability software package:
https://support.hpe.com/hpsc/swd/public/detail?swItemId=MTX_69f72d896167451a9e0a9d5f39
Valgrind:
http://valgrind.org/downloads/current.html#current
Steps to Reproduce:
1.Install the Manageability software package
2.Install Valgrind
3.Stop service: systemctl stop amsd
4.valgrind --leak-check=full /sbin/amsd -f
Actual results:
Please check the log files
Expected results:
Additional info:
These leaks are caused by the application not shutting down librpm at exit by calling rpmFreeRpmrc(). This is required to release various resources used by librpm in all rpm versions, that older Lua versions do not appear to leak memory when not properly shut down is an internal implementation detail of Lua.
Using the default OS snmpd package will memory leak checking, I got a similar memory leak pattern.
Command:
valgrind --leak-check=full /usr/sbin/snmpd -f
Net-snmp packages:
net-snmp-agent-libs-5.8-7.el8.x86_64
net-snmp-libs-5.8-7.el8.x86_64
net-snmp-5.8-7.el8.x86_64
net-snmp-utils-5.8-7.el8.x86_64
net-snmp-devel-5.8-7.el8.x86_64
(In reply to andy.liang from comment #2)
> Using the default OS snmpd package will memory leak checking, I got a
> similar memory leak pattern.
>
So that's a memory leak in snmpd then. And sure enough:
[pmatilai🎩︎lumikko-w net-snmp-5.8]$ find -name "*.c"|xargs grep rpmFreeRpmrc
[pmatilai🎩︎lumikko-w net-snmp-5.8]$
It doesn't shutdown librpm when done, so it leaks. This is an application error, whether it's in a distro component or 3rd party software.
Created attachment 1641913[details]
This patch is for net-snmp 5.8
By the Panu's comment, I made a patch that works fine ay my side, but I don't know is there any side effects. Please review the patch. Thanks.
Thanks a lot for the patch.
In agent/mibgroup/host/hr_swinst.c: rpmFreeRpmrc() method could be called even after line #223, similarly in agent/mibgroup/host/data_access/swinst_rpm.c: rpmFreeRpmrc() method could be called after line #70, but from functional point of view, it doesn't matter. By this change, we would just save two #ifdef conditions.
Let's wait for upstream acceptance to have it part of RHEL-8.
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:4576