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 1758494 - LeakSanitizer: detected memory leaks in do_add
Summary: LeakSanitizer: detected memory leaks in do_add
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: 389-ds-base
Version: 8.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 8.2
Assignee: thierry bordaz
QA Contact: RHDS QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-10-04 10:04 UTC by Viktor Ashirov
Modified: 2023-02-12 21:51 UTC (History)
7 users (show)

Fixed In Version: 389-ds-base-1.4.2.4-7.module+el8.2.0+5670+0b8b1c2e
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-04-28 16:01:22 UTC
Type: Bug
Target Upstream Version:
Embargoed:
mreynolds: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-32310 0 None None None 2023-02-12 21:51:57 UTC
Red Hat Product Errata RHBA-2020:1703 0 None None None 2020-04-28 16:01:43 UTC

Description Viktor Ashirov 2019-10-04 10:04:39 UTC
Description of problem:

=================================================================
==29424==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 32 byte(s) in 2 object(s) allocated from:
    #0 0x7f7dc1abdae8 in __interceptor_malloc (/lib64/libasan.so.5+0xefae8)
    #1 0x7f7dc1325297 in slapi_ch_malloc (/usr/lib64/dirsrv/libslapd.so.0+0xdc297)
    #2 0x7f7dc149c53d in valuearray_add_valuearray_fast (/usr/lib64/dirsrv/libslapd.so.0+0x25353d)
    #3 0x7f7dc149c8ee in valuearray_add_valuearray (/usr/lib64/dirsrv/libslapd.so.0+0x2538ee)
    #4 0x7f7dc130a71f  (/usr/lib64/dirsrv/libslapd.so.0+0xc171f)
    #5 0x7f7dc130df4a in do_add (/usr/lib64/dirsrv/libslapd.so.0+0xc4f4a)
    #6 0x55c689a18934  (/usr/sbin/ns-slapd+0x45934)
    #7 0x7f7dbec11567  (/lib64/libnspr4.so+0x2b567)

Indirect leak of 64 byte(s) in 2 object(s) allocated from:
    #0 0x7f7dc1abdae8 in __interceptor_malloc (/lib64/libasan.so.5+0xefae8)
    #1 0x7f7dc1325297 in slapi_ch_malloc (/usr/lib64/dirsrv/libslapd.so.0+0xdc297)
    #2 0x7f7dc149a6f0 in value_new (/usr/lib64/dirsrv/libslapd.so.0+0x2516f0)
    #3 0x7f7dc149a776 in slapi_value_dup (/usr/lib64/dirsrv/libslapd.so.0+0x251776)
    #4 0x7f7dc149c40d in valuearray_add_valuearray_fast (/usr/lib64/dirsrv/libslapd.so.0+0x25340d)
    #5 0x7f7dc149c8ee in valuearray_add_valuearray (/usr/lib64/dirsrv/libslapd.so.0+0x2538ee)
    #6 0x7f7dc130a71f  (/usr/lib64/dirsrv/libslapd.so.0+0xc171f)
    #7 0x7f7dc130df4a in do_add (/usr/lib64/dirsrv/libslapd.so.0+0xc4f4a)
    #8 0x55c689a18934  (/usr/sbin/ns-slapd+0x45934)
    #9 0x7f7dbec11567  (/lib64/libnspr4.so+0x2b567)

Indirect leak of 18 byte(s) in 2 object(s) allocated from:
    #0 0x7f7dc1abdae8 in __interceptor_malloc (/lib64/libasan.so.5+0xefae8)
    #1 0x7f7dc1325297 in slapi_ch_malloc (/usr/lib64/dirsrv/libslapd.so.0+0xdc297)
    #2 0x7f7dc149a1b2  (/usr/lib64/dirsrv/libslapd.so.0+0x2511b2)
    #3 0x7f7dc149a625 in slapi_value_set_berval (/usr/lib64/dirsrv/libslapd.so.0+0x251625)
    #4 0x7f7dc149a685 in value_init (/usr/lib64/dirsrv/libslapd.so.0+0x251685)
    #5 0x7f7dc149a704 in value_new (/usr/lib64/dirsrv/libslapd.so.0+0x251704)
    #6 0x7f7dc149a776 in slapi_value_dup (/usr/lib64/dirsrv/libslapd.so.0+0x251776)
    #7 0x7f7dc149c40d in valuearray_add_valuearray_fast (/usr/lib64/dirsrv/libslapd.so.0+0x25340d)
    #8 0x7f7dc149c8ee in valuearray_add_valuearray (/usr/lib64/dirsrv/libslapd.so.0+0x2538ee)
    #9 0x7f7dc130a71f  (/usr/lib64/dirsrv/libslapd.so.0+0xc171f)
    #10 0x7f7dc130df4a in do_add (/usr/lib64/dirsrv/libslapd.so.0+0xc4f4a)
    #11 0x55c689a18934  (/usr/sbin/ns-slapd+0x45934)
    #12 0x7f7dbec11567  (/lib64/libnspr4.so+0x2b567)

SUMMARY: AddressSanitizer: 114 byte(s) leaked in 6 allocation(s).

Version-Release number of selected component (if applicable):
389-ds-base-1.4.1.3-7.module+el8.1.0+4150+5b8c2c1f.x86_64


How reproducible:
always

Steps to Reproduce:
1. Rebuild 389-ds-base with ASAN
2. Run tests/suites/basic/basic_test.py::test_basic_referrals
3.

Actual results:
Memory leaks are reported by ASAN

Expected results:
No errors from ASAN

Additional info:
Might be already fixed by https://pagure.io/389-ds-base/pull-request/50523

Comment 2 thierry bordaz 2020-01-22 12:49:35 UTC
This leak is fixed in master.

The leak occurred when nsslapd-unhashed-pw-switch == off. nsslapd-unhashed-pw-switch default value was recently changed to 'off' that explains why we did not detect the leak before (with the same test case)

As suggested in the bug description it was fixed with https://pagure.io/389-ds-base/pull-request/50523 (git log -p -1 340f23990199698cb42b4a4e2686d3c404745800 ldap/servers/slapd/add.c)
It was fixed without BZ so switch this bug to POST

Comment 4 Viktor Ashirov 2020-02-24 12:42:43 UTC
====================================================================================================== test session starts ======================================================================================================
platform linux -- Python 3.6.8, pytest-5.3.5, py-1.8.1, pluggy-0.13.1 -- /usr/bin/python3.6
cachedir: .pytest_cache
metadata: {'Python': '3.6.8', 'Platform': 'Linux-4.18.0-179.el8.x86_64-x86_64-with-redhat-8.2-Ootpa', 'Packages': {'pytest': '5.3.5', 'py': '1.8.1', 'pluggy': '0.13.1'}, 'Plugins': {'metadata': '1.8.0', 'html': '2.0.1'}}
389-ds-base: 1.4.2.4-7.1asan.el8
nss: 3.44.0-15.el8
nspr: 4.21.0-2.el8_0
openldap: 2.4.46-11.el8
cyrus-sasl: 2.1.27-1.el8
FIPS: disabled
rootdir: /mnt/tests/rhds/tests/upstream/ds/dirsrvtests, inifile: pytest.ini
plugins: metadata-1.8.0, html-2.0.1
collected 1 item

ds/dirsrvtests/tests/suites/basic/basic_test.py::test_basic_referrals PASSED                                                                                                                                              [100%]

================================================================================================ 1 passed, 16 warnings in 23.23s ================================================================================================

Automated test passed, no leaks reported.
Marking as VERIFIED.

Comment 6 errata-xmlrpc 2020-04-28 16:01:22 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, 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:1703


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