Bug 1866113

Summary: Valgrind reports a memory leak in the Schema Compatibility plugin. [rhel-7.9.z]
Product: Red Hat Enterprise Linux 7 Reporter: Têko Mihinto <tmihinto>
Component: slapi-nisAssignee: Alexander Bokovoy <abokovoy>
Status: CLOSED ERRATA QA Contact: ipa-qe <ipa-qe>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.8CC: abokovoy, amore, asharov, cww, jreznik, ksiddiqu, rmarigny, sumenon
Target Milestone: rcKeywords: ZStream
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: slapi-nis-0.56.5-3 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1875348 (view as bug list) Environment:
Last Closed: 2021-03-16 13:56:39 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1875348    

Description Têko Mihinto 2020-08-04 21:55:59 UTC
Description of problem:
A customer is observing memory leak(s) in the LDAP server of the IPA stack.
A Valgrind report shows the following stack as the most important leak:

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
==1804== 838,658,456 bytes in 13,526,838 blocks are definitely lost in loss record 2,607 of 2,607
==1804==    at 0x4C29F73: malloc (vg_replace_malloc.c:309)
==1804==    by 0x8297AF9: strdup (strdup.c:42)
==1804==    by 0x5094712: slapi_ch_strdup (ch_malloc.c:196)
==1804==    by 0x1B0FE676: ??? (in /usr/lib64/dirsrv/plugins/schemacompat-plugin.so)
==1804==    by 0x50E7337: plugin_call_func (plugin.c:2028)
==1804==    by 0x50E75F2: plugin_call_list (plugin.c:1972)
==1804==    by 0x50E75F2: plugin_call_plugins (plugin.c:442)
==1804==    by 0x50DA2E6: op_shared_search (opshared.c:559)
==1804==    by 0x135C0D: do_search (search.c:352)
==1804==    by 0x123989: connection_dispatch_operation (connection.c:651)
==1804==    by 0x123989: connection_threadmain (connection.c:1793)
==1804==    by 0x7339BFA: _pt_root (ptthread.c:201)
==1804==    by 0x7979EA4: start_thread (pthread_create.c:307)
==1804==    by 0x83098DC: clone (clone.S:111)
==1804==
==1804== LEAK SUMMARY:
==1804==    definitely lost: 853,769,929 bytes in 14,317,086 blocks
==1804==    indirectly lost: 277,511 bytes in 7,592 blocks
==1804==      possibly lost: 10,610 bytes in 122 blocks
==1804==    still reachable: 7,454,258 bytes in 40,394 blocks
==1804==                       of which reachable via heuristic:
==1804==                         stdstring          : 30 bytes in 1 blocks
==1804==         suppressed: 0 bytes in 0 blocks
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


Version-Release number of selected component (if applicable):
$ cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 7.8 (Maipo)
$
$ grep 389-ds-base installed-rpms 
389-ds-base-1.3.10.1-9.el7_8.x86_64                         Mon May 18 10:58:11 2020
389-ds-base-debuginfo-1.3.10.1-9.el7_8.x86_64               Thu Jun 11 08:32:56 2020
389-ds-base-libs-1.3.10.1-9.el7_8.x86_64                    Mon May 18 10:58:10 2020
389-ds-base-snmp-1.3.10.1-9.el7_8.x86_64                    Mon May 18 10:58:30 2020
$
$ grep slapi installed-rpms 
slapi-nis-0.56.0-13.el7.x86_64                              Tue Apr 21 19:17:54 2020
$

How reproducible:
Always in the customer environment.

Steps to Reproduce:
Customer was asked to run the LDAP server with Valgrind which reported the leaks.

Actual results:
Memory leaks forcing to restart the IPA servers every 3 or 4 weeks.

Expected results:
Controlled memory usage.

Additional info:

Comment 6 Alexander Bokovoy 2020-08-31 14:01:02 UTC
PR: https://pagure.io/slapi-nis/pull-request/38

Comment 7 Alexander Bokovoy 2020-09-01 10:03:47 UTC
Merged upstream.

Comment 24 Sudhir Menon 2021-02-09 07:55:27 UTC
slapi-nis build on the test system: slapi-nis-0.56.5-3.el7_9.x86_64

Comment 28 errata-xmlrpc 2021-03-16 13:56:39 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 (slapi-nis 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-2021:0861