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 2115348 - memory leak with filter optimizer
Summary: memory leak with filter optimizer
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: 389-ds-base
Version: 9.1
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: 9.1
Assignee: mreynolds
QA Contact: RHDS QE
URL:
Whiteboard: sync-to-jira
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-08-04 13:18 UTC by mreynolds
Modified: 2022-11-15 11:37 UTC (History)
4 users (show)

Fixed In Version: 389-ds-base-2.1.3-3.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-11-15 10:30:16 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker IDMDS-2416 0 None None None 2022-08-04 13:24:45 UTC
Red Hat Issue Tracker IDMDS-2433 0 None None None 2022-08-08 20:05:43 UTC
Red Hat Issue Tracker RHELPLAN-130308 0 None None None 2022-08-04 13:24:51 UTC
Red Hat Product Errata RHSA-2022:8162 0 None None None 2022-11-15 10:31:04 UTC

Description mreynolds 2022-08-04 13:18:32 UTC
Description of problem:
 
Looks like we have some memory leaks caused by the filter optimizer RFE:

Indirect leak of 120 byte(s) in 10 object(s) allocated from:
    #0 0x7fc6a5cae377 in strdup (/lib64/libasan.so.6+0x5a377)
    #1 0x7fc6a54db0bb in slapi_ch_strdup ldap/servers/slapd/ch_malloc.c:196
    #2 0x7fc6a54ca26c in slapi_attr_syntax_normalize ldap/servers/slapd/attrsyntax.c:539
    #3 0x7fc6a5535bac in filter_normalize_ava ldap/servers/slapd/filter.c:1046
    #4 0x7fc6a5536a4f in filter_normalize_ext ldap/servers/slapd/filter.c:1144
    #5 0x7fc6a5536916 in filter_normalize_list ldap/servers/slapd/filter.c:1118
    #6 0x7fc6a5536ca0 in filter_normalize_ext ldap/servers/slapd/filter.c:1165
    #7 0x7fc6a5536916 in filter_normalize_list ldap/servers/slapd/filter.c:1118
    #8 0x7fc6a5536c64 in filter_normalize_ext ldap/servers/slapd/filter.c:1162
    #9 0x7fc6a5536d8b in slapi_filter_normalize ldap/servers/slapd/filter.c:1184
    #10 0x7fc69d54d083 in ldbm_back_search ldap/servers/slapd/back-ldbm/ldbm_search.c:959
    #11 0x7fc6a55c0eb1 in op_shared_search ldap/servers/slapd/opshared.c:821
    #12 0x7fc6a5607e6a in search_internal_callback_pb ldap/servers/slapd/plugin_internal_op.c:730
    #13 0x7fc6a5606ea7 in search_internal_pb ldap/servers/slapd/plugin_internal_op.c:594
    #14 0x7fc6a56067ba in slapi_search_internal_pb ldap/servers/slapd/plugin_internal_op.c:504
    #15 0x7fc6a56bf134 in vattr_check_thread ldap/servers/slapd/vattr.c:183
    #16 0x7fc6a4a48553 in _pt_root ../../.././nspr/pr/src/pthreads/ptthread.c:201


Indirect leak of 180 byte(s) in 10 object(s) allocated from:
    #0 0x7fc6a5d04627 in __interceptor_malloc (/lib64/libasan.so.6+0xb0627)
    #1 0x7fc6a54dab91 in slapi_ch_malloc ldap/servers/slapd/ch_malloc.c:95
    #2 0x7fc6a56b3e60 in ber_bvcpy ldap/servers/slapd/value.c:48
    #3 0x7fc6a56b3f87 in slapi_ber_bvcpy ldap/servers/slapd/value.c:65
    #4 0x7fc6a5534422 in slapi_filter_dup ldap/servers/slapd/filter.c:702
    #5 0x7fc6a5534669 in slapi_filter_dup ldap/servers/slapd/filter.c:722
    #6 0x7fc6a5534669 in slapi_filter_dup ldap/servers/slapd/filter.c:722
    #7 0x7fc69d54d038 in ldbm_back_search ldap/servers/slapd/back-ldbm/ldbm_search.c:958
    #8 0x7fc6a55c0eb1 in op_shared_search ldap/servers/slapd/opshared.c:821
    #9 0x7fc6a5607e6a in search_internal_callback_pb ldap/servers/slapd/plugin_internal_op.c:730
    #10 0x7fc6a5606ea7 in search_internal_pb ldap/servers/slapd/plugin_internal_op.c:594
    #11 0x7fc6a56067ba in slapi_search_internal_pb ldap/servers/slapd/plugin_internal_op.c:504
    #12 0x7fc6a56bf134 in vattr_check_thread ldap/servers/slapd/vattr.c:183
    #13 0x7fc6a4a48553 in _pt_root ../../.././nspr/pr/src/pthreads/ptthread.c:201


Indirect leak of 256 byte(s) in 2 object(s) allocated from:
    #0 0x7fc6a5d047f7 in __interceptor_calloc (/lib64/libasan.so.6+0xb07f7)
    #1 0x7fc6a54dafd3 in slapi_ch_calloc ldap/servers/slapd/ch_malloc.c:175
    #2 0x7fc6a55341b4 in slapi_filter_dup ldap/servers/slapd/filter.c:685
    #3 0x7fc69d54d038 in ldbm_back_search ldap/servers/slapd/back-ldbm/ldbm_search.c:958
    #4 0x7fc6a55c0eb1 in op_shared_search ldap/servers/slapd/opshared.c:821
    #5 0x4807dd in do_search ldap/servers/slapd/search.c:410
    #6 0x430824 in connection_dispatch_operation ldap/servers/slapd/connection.c:692
    #7 0x436c4f in connection_threadmain ldap/servers/slapd/connection.c:1841
    #8 0x7fc6a4a48553 in _pt_root ../../.././nspr/pr/src/pthreads/ptthread.c:201

Comment 1 mreynolds 2022-08-04 13:20:27 UTC
Upstream ticket:

https://github.com/389ds/389-ds-base/issues/5397

Comment 2 Pierre Rogier 2022-08-04 16:17:00 UTC
FYI: I reproduce the leak while testing another issue on an ASAN build:
So we have a reproducer by simply running:
    pytest $PWD -k test_reset_pwd_before_passwordTPRDelayValidFrom

Comment 3 Akshay Adhikari 2022-08-26 13:31:46 UTC
============================================================================ test session starts =================================================================
platform linux -- Python 3.9.13, pytest-5.4.3, py-1.11.0, pluggy-0.13.1 -- /usr/bin/python3
cachedir: .pytest_cache
metadata: {'Python': '3.9.13', 'Platform': 'Linux-5.14.0-149.el9.x86_64-x86_64-with-glibc2.34', 'Packages': {'pytest': '5.4.3', 'py': '1.11.0', 'pluggy': '0.13.1'}, 'Plugins': {'metadata': '2.0.2', 'html': '3.1.1', 'libfaketime': '0.1.2', 'flaky': '3.7.0'}}
389-ds-base: 2.1.3-3.1asan.el9
nss: 3.79.0-12.el9_0
nspr: 4.34.0-12.el9_0
openldap: 2.6.2-3.el9
cyrus-sasl: 2.1.27-20.el9
FIPS: disabled
rootdir: /root/test/389-ds-base/dirsrvtests, inifile: pytest.ini
plugins: metadata-2.0.2, html-3.1.1, libfaketime-0.1.2, flaky-3.7.0
collected 1 item                                                                                                                                                            

dirsrvtests/tests/suites/password/password_TPR_policy_test.py::test_reset_pwd_before_passwordTPRDelayValidFrom PASSED                                                 [100%]

============================================================================ 1 passed in 12.30s ==================================================================

Marking as Verified: Tested.

Comment 8 errata-xmlrpc 2022-11-15 10:30:16 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 (Moderate: 389-ds-base security, 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/RHSA-2022:8162


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