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 1800529 - Memory leaks in disk monitoring
Summary: Memory leaks in disk monitoring
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: 389-ds-base
Version: 8.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 8.0
Assignee: Simon Pichugin
QA Contact: RHDS QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-02-07 11:22 UTC by Viktor Ashirov
Modified: 2020-11-04 03:08 UTC (History)
6 users (show)

Fixed In Version: 389-ds-1.4-8030020200805152009.618f7055
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-11-04 03:07:24 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2020:4695 0 None None None 2020-11-04 03:07:38 UTC

Description Viktor Ashirov 2020-02-07 11:22:28 UTC
Description of problem:
Memory leaks are reported by the disk monitoring test suite:

=================================================================
==9128==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 24 byte(s) in 1 object(s) allocated from:
    #0 0x7fd43c0b2fb8 in __interceptor_realloc (/lib64/libasan.so.5+0xeffb8)
    #1 0x7fd43bb2d6ff in slapi_ch_realloc (/usr/lib64/dirsrv/libslapd.so.0+0xdb6ff)
    #2 0x7fd43bb2b6cf in slapi_ch_array_add_ext (/usr/lib64/dirsrv/libslapd.so.0+0xd96cf)
    #3 0x55e9f5e75420 in disk_mon_add_dir ldap/servers/slapd/daemon.c:258
    #4 0x55e9f5e7563d in disk_mon_get_dirs ldap/servers/slapd/daemon.c:285
    #5 0x55e9f5e760c9 in disk_monitoring_thread ldap/servers/slapd/daemon.c:453
    #6 0x7fd43941a567  (/lib64/libnspr4.so+0x2b567)

Indirect leak of 34 byte(s) in 1 object(s) allocated from:
    #0 0x7fd43bffed70 in strdup (/lib64/libasan.so.5+0x3bd70)
    #1 0x7fd43bb2d8fd in slapi_ch_strdup (/usr/lib64/dirsrv/libslapd.so.0+0xdb8fd)
    #2 0x55e9f5e75229 in disk_mon_get_mount_point ldap/servers/slapd/daemon.c:224
    #3 0x55e9f5e753a6 in disk_mon_add_dir ldap/servers/slapd/daemon.c:251
    #4 0x55e9f5e7563d in disk_mon_get_dirs ldap/servers/slapd/daemon.c:285
    #5 0x55e9f5e760c9 in disk_monitoring_thread ldap/servers/slapd/daemon.c:453
    #6 0x7fd43941a567  (/lib64/libnspr4.so+0x2b567)

Indirect leak of 2 byte(s) in 1 object(s) allocated from:
    #0 0x7fd43bffed70 in strdup (/lib64/libasan.so.5+0x3bd70)
    #1 0x7fd43bb2d8fd in slapi_ch_strdup (/usr/lib64/dirsrv/libslapd.so.0+0xdb8fd)
    #2 0x55e9f5e75229 in disk_mon_get_mount_point ldap/servers/slapd/daemon.c:224
    #3 0x55e9f5e753a6 in disk_mon_add_dir ldap/servers/slapd/daemon.c:251
    #4 0x55e9f5e755d0 in disk_mon_get_dirs ldap/servers/slapd/daemon.c:277
    #5 0x55e9f5e760c9 in disk_monitoring_thread ldap/servers/slapd/daemon.c:453
    #6 0x7fd43941a567  (/lib64/libnspr4.so+0x2b567)

SUMMARY: AddressSanitizer: 60 byte(s) leaked in 3 allocation(s).


Version-Release number of selected component (if applicable):
389-ds-base-1.4.2.4-6.module+el8.2.0+5509+885f7879

This is a continuation of https://bugzilla.redhat.com/show_bug.cgi?id=1758473

Comment 1 Simon Pichugin 2020-03-26 12:29:37 UTC
https://pagure.io/389-ds-base/issue/50984

Comment 4 sgouvern 2020-06-03 07:51:54 UTC
With build 389-ds-base-1.4.3.8-2.module+el8.3.0+6591+ebfc9766.x86_64 / 389-ds-base-1.4.3.8-2.1asan.el8.x86_64

ASAN didn't report any memory leaks when running dirsrvtests/tests/suites/disk_monitoring/disk_monitoring_test.py

Marking as Verified

Comment 5 sgouvern 2020-06-04 09:25:02 UTC
By mistake, I missed a memory leak report hidden amongst other heap-use-after-free reports created by ASAN during dirsrvtests/tests/suites/disk_monitoring/disk_monitoring_test.py execution with build 389-ds-base-1.4.3.8-2.module+el8.3.0+6591+ebfc9766.x86_64 / 389-ds-base-1.4.3.8-2.1asan.el8.x86_64 :

=================================================================
==278469==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 24 byte(s) in 1 object(s) allocated from:
    #0 0x7fe4f2950fe8 in __interceptor_realloc (/lib64/libasan.so.5+0xeffe8)
    #1 0x7fe4f23c5f3f in slapi_ch_realloc (/usr/lib64/dirsrv/libslapd.so.0+0xdcf3f)
    #2 0x7fe4f23c3f0f in slapi_ch_array_add_ext (/usr/lib64/dirsrv/libslapd.so.0+0xdaf0f)
    #3 0x560251df8460 in disk_mon_add_dir ldap/servers/slapd/daemon.c:258
    #4 0x560251df867d in disk_mon_get_dirs ldap/servers/slapd/daemon.c:285
    #5 0x560251ddc772 in main (/usr/sbin/ns-slapd+0x30772)
    #6 0x7fe4eed077b2 in __libc_start_main (/lib64/libc.so.6+0x237b2)

Direct leak of 16 byte(s) in 1 object(s) allocated from:
    #0 0x7fe4f2950db0 in calloc (/lib64/libasan.so.5+0xefdb0)
    #1 0x7fe4f23c6035 in slapi_ch_calloc (/usr/lib64/dirsrv/libslapd.so.0+0xdd035)
    #2 0x560251df791a in createprlistensockets ldap/servers/slapd/daemon.c:2397
    #3 0x560251df8045 in daemon_pre_setuid_init ldap/servers/slapd/daemon.c:167
    #4 0x560251dda6bb in main (/usr/sbin/ns-slapd+0x2e6bb)
    #5 0x7fe4eed077b2 in __libc_start_main (/lib64/libc.so.6+0x237b2)

Direct leak of 16 byte(s) in 1 object(s) allocated from:
    #0 0x7fe4f2950db0 in calloc (/lib64/libasan.so.5+0xefdb0)
    #1 0x7fe4f23c6035 in slapi_ch_calloc (/usr/lib64/dirsrv/libslapd.so.0+0xdd035)
    #2 0x560251dda56b in main (/usr/sbin/ns-slapd+0x2e56b)
    #3 0x7fe4eed077b2 in __libc_start_main (/lib64/libc.so.6+0x237b2)

Direct leak of 16 byte(s) in 1 object(s) allocated from:
    #0 0x7fe4f2950db0 in calloc (/lib64/libasan.so.5+0xefdb0)
    #1 0x7fe4f23c6035 in slapi_ch_calloc (/usr/lib64/dirsrv/libslapd.so.0+0xdd035)
    #2 0x560251dfba11 in slapd_listenhost2addr ldap/servers/slapd/daemon.c:2501
    #3 0x560251dd9f70 in main (/usr/sbin/ns-slapd+0x2df70)
    #4 0x7fe4eed077b2 in __libc_start_main (/lib64/libc.so.6+0x237b2)

Direct leak of 16 byte(s) in 1 object(s) allocated from:
    #0 0x7fe4f2950db0 in calloc (/lib64/libasan.so.5+0xefdb0)
    #1 0x7fe4f23c6035 in slapi_ch_calloc (/usr/lib64/dirsrv/libslapd.so.0+0xdd035)
    #2 0x560251dfba11 in slapd_listenhost2addr ldap/servers/slapd/daemon.c:2501
    #3 0x560251dda04d in main (/usr/sbin/ns-slapd+0x2e04d)
    #4 0x7fe4eed077b2 in __libc_start_main (/lib64/libc.so.6+0x237b2)

Direct leak of 16 byte(s) in 1 object(s) allocated from:
    #0 0x7fe4f2950db0 in calloc (/lib64/libasan.so.5+0xefdb0)
    #1 0x7fe4f23c6035 in slapi_ch_calloc (/usr/lib64/dirsrv/libslapd.so.0+0xdd035)
    #2 0x560251df791a in createprlistensockets ldap/servers/slapd/daemon.c:2397
    #3 0x560251df7ffa in daemon_pre_setuid_init ldap/servers/slapd/daemon.c:181
    #4 0x560251dda6bb in main (/usr/sbin/ns-slapd+0x2e6bb)
    #5 0x7fe4eed077b2 in __libc_start_main (/lib64/libc.so.6+0x237b2)

Indirect leak of 112 byte(s) in 1 object(s) allocated from:
    #0 0x7fe4f2950db0 in calloc (/lib64/libasan.so.5+0xefdb0)
    #1 0x7fe4f23c6035 in slapi_ch_calloc (/usr/lib64/dirsrv/libslapd.so.0+0xdd035)
    #2 0x560251dda5c7 in main (/usr/sbin/ns-slapd+0x2e5c7)
    #3 0x7fe4eed077b2 in __libc_start_main (/lib64/libc.so.6+0x237b2)

Indirect leak of 112 byte(s) in 1 object(s) allocated from:
    #0 0x7fe4f2950db0 in calloc (/lib64/libasan.so.5+0xefdb0)
    #1 0x7fe4f23c6035 in slapi_ch_calloc (/usr/lib64/dirsrv/libslapd.so.0+0xdd035)
    #2 0x560251dfb4d7 in slapd_listenhost2addr ldap/servers/slapd/daemon.c:2486
    #3 0x560251dda04d in main (/usr/sbin/ns-slapd+0x2e04d)
    #4 0x7fe4eed077b2 in __libc_start_main (/lib64/libc.so.6+0x237b2)

Indirect leak of 112 byte(s) in 1 object(s) allocated from:
    #0 0x7fe4f2950db0 in calloc (/lib64/libasan.so.5+0xefdb0)
    #1 0x7fe4f23c6035 in slapi_ch_calloc (/usr/lib64/dirsrv/libslapd.so.0+0xdd035)
    #2 0x560251dfb4d7 in slapd_listenhost2addr ldap/servers/slapd/daemon.c:2486
    #3 0x560251dd9f70 in main (/usr/sbin/ns-slapd+0x2df70)
    #4 0x7fe4eed077b2 in __libc_start_main (/lib64/libc.so.6+0x237b2)

Indirect leak of 96 byte(s) in 2 object(s) allocated from:
    #0 0x7fe4f2950ba8 in __interceptor_malloc (/lib64/libasan.so.5+0xefba8)
    #1 0x7fe4efc93fce  (/lib64/libnspr4.so+0xdfce)

Indirect leak of 80 byte(s) in 2 object(s) allocated from:
    #0 0x7fe4f2950ba8 in __interceptor_malloc (/lib64/libasan.so.5+0xefba8)
    #1 0x7fe4efc93fe0  (/lib64/libnspr4.so+0xdfe0)

Indirect leak of 34 byte(s) in 1 object(s) allocated from:
    #0 0x7fe4f289cda0 in strdup (/lib64/libasan.so.5+0x3bda0)
    #1 0x7fe4f23c613d in slapi_ch_strdup (/usr/lib64/dirsrv/libslapd.so.0+0xdd13d)
    #2 0x560251df8269 in disk_mon_get_mount_point ldap/servers/slapd/daemon.c:224
    #3 0x560251df83e6 in disk_mon_add_dir ldap/servers/slapd/daemon.c:251
    #4 0x560251df867d in disk_mon_get_dirs ldap/servers/slapd/daemon.c:285
    #5 0x560251ddc772 in main (/usr/sbin/ns-slapd+0x30772)
    #6 0x7fe4eed077b2 in __libc_start_main (/lib64/libc.so.6+0x237b2)

Indirect leak of 2 byte(s) in 1 object(s) allocated from:
    #0 0x7fe4f289cda0 in strdup (/lib64/libasan.so.5+0x3bda0)
    #1 0x7fe4f23c613d in slapi_ch_strdup (/usr/lib64/dirsrv/libslapd.so.0+0xdd13d)
    #2 0x560251df8269 in disk_mon_get_mount_point ldap/servers/slapd/daemon.c:224
    #3 0x560251df83e6 in disk_mon_add_dir ldap/servers/slapd/daemon.c:251
    #4 0x560251df8610 in disk_mon_get_dirs ldap/servers/slapd/daemon.c:277
    #5 0x560251ddc772 in main (/usr/sbin/ns-slapd+0x30772)
    #6 0x7fe4eed077b2 in __libc_start_main (/lib64/libc.so.6+0x237b2)

SUMMARY: AddressSanitizer: 652 byte(s) leaked in 15 allocation(s).

-> Reassigning and marking as failed QA

Comment 6 Simon Pichugin 2020-07-16 15:44:33 UTC
I've just checked the recent build and I don't see the memory leaks... Could you please put the stack traces and the build version where you expirience it?

Comment 7 sgouvern 2020-07-16 16:03:27 UTC
Yes sorry, I missed my comment along the way ...

On build 389-ds-base-1.4.3.8-4.1asan.el8.x86_64

running # DISK_MONITORING_ACK=1 ASAN=1 py.test -s -v ds/dirsrvtests/tests/suites/disk_monitoring/disk_monitoring_test.py

# grep leak /run/dirsrv/*
/run/dirsrv/ns-slapd-standalone1.asan.290959:==290959==ERROR: LeakSanitizer: detected memory leaks
/run/dirsrv/ns-slapd-standalone1.asan.290959:Direct leak of 24 byte(s) in 1 object(s) allocated from:
/run/dirsrv/ns-slapd-standalone1.asan.290959:Direct leak of 16 byte(s) in 1 object(s) allocated from:
/run/dirsrv/ns-slapd-standalone1.asan.290959:Direct leak of 16 byte(s) in 1 object(s) allocated from:
/run/dirsrv/ns-slapd-standalone1.asan.290959:Direct leak of 16 byte(s) in 1 object(s) allocated from:
/run/dirsrv/ns-slapd-standalone1.asan.290959:Indirect leak of 112 byte(s) in 1 object(s) allocated from:
/run/dirsrv/ns-slapd-standalone1.asan.290959:Indirect leak of 112 byte(s) in 1 object(s) allocated from:
/run/dirsrv/ns-slapd-standalone1.asan.290959:Indirect leak of 48 byte(s) in 1 object(s) allocated from:
/run/dirsrv/ns-slapd-standalone1.asan.290959:Indirect leak of 40 byte(s) in 1 object(s) allocated from:
/run/dirsrv/ns-slapd-standalone1.asan.290959:Indirect leak of 34 byte(s) in 1 object(s) allocated from:
/run/dirsrv/ns-slapd-standalone1.asan.290959:Indirect leak of 2 byte(s) in 1 object(s) allocated from:
/run/dirsrv/ns-slapd-standalone1.asan.290959:SUMMARY: AddressSanitizer: 420 byte(s) leaked in 10 allocation(s)

# more /run/dirsrv/ns-slapd-standalone1.asan.290959
Direct leak of 24 byte(s) in 1 object(s) allocated from:
    #0 0x7f1b3083efe8 in __interceptor_realloc (/lib64/libasan.so.5+0xeffe8)
    #1 0x7f1b302b24af in slapi_ch_realloc (/usr/lib64/dirsrv/libslapd.so.0+0xdd4af)
    #2 0x7f1b302b047f in slapi_ch_array_add_ext (/usr/lib64/dirsrv/libslapd.so.0+0xdb47f)
    #3 0x556693f0e660 in disk_mon_add_dir ldap/servers/slapd/daemon.c:258
    #4 0x556693f0e87d in disk_mon_get_dirs ldap/servers/slapd/daemon.c:285
    #5 0x556693ef2902 in main (/usr/sbin/ns-slapd+0x30902)
    #6 0x7f1b2cbfd7b2 in __libc_start_main (/lib64/libc.so.6+0x237b2)

Direct leak of 16 byte(s) in 1 object(s) allocated from:
    #0 0x7f1b3083edb0 in calloc (/lib64/libasan.so.5+0xefdb0)
    #1 0x7f1b302b25a5 in slapi_ch_calloc (/usr/lib64/dirsrv/libslapd.so.0+0xdd5a5)
    #2 0x556693f0db1a in createprlistensockets ldap/servers/slapd/daemon.c:2392
    #3 0x556693f0e245 in daemon_pre_setuid_init ldap/servers/slapd/daemon.c:167
    #4 0x556693ef084b in main (/usr/sbin/ns-slapd+0x2e84b)
    #5 0x7f1b2cbfd7b2 in __libc_start_main (/lib64/libc.so.6+0x237b2)

Direct leak of 16 byte(s) in 1 object(s) allocated from:
    #0 0x7f1b3083edb0 in calloc (/lib64/libasan.so.5+0xefdb0)
    #1 0x7f1b302b25a5 in slapi_ch_calloc (/usr/lib64/dirsrv/libslapd.so.0+0xdd5a5)
    #2 0x556693f11c41 in slapd_listenhost2addr ldap/servers/slapd/daemon.c:2496
    #3 0x556693ef01dd in main (/usr/sbin/ns-slapd+0x2e1dd)
    #4 0x7f1b2cbfd7b2 in __libc_start_main (/lib64/libc.so.6+0x237b2)

Direct leak of 16 byte(s) in 1 object(s) allocated from:
    #0 0x7f1b3083edb0 in calloc (/lib64/libasan.so.5+0xefdb0)
    #1 0x7f1b302b25a5 in slapi_ch_calloc (/usr/lib64/dirsrv/libslapd.so.0+0xdd5a5)
    #2 0x556693f11c41 in slapd_listenhost2addr ldap/servers/slapd/daemon.c:2496
    #3 0x556693ef0100 in main (/usr/sbin/ns-slapd+0x2e100)
    #4 0x7f1b2cbfd7b2 in __libc_start_main (/lib64/libc.so.6+0x237b2)

Indirect leak of 112 byte(s) in 1 object(s) allocated from:
    #0 0x7f1b3083edb0 in calloc (/lib64/libasan.so.5+0xefdb0)
    #1 0x7f1b302b25a5 in slapi_ch_calloc (/usr/lib64/dirsrv/libslapd.so.0+0xdd5a5)
    #2 0x556693f11707 in slapd_listenhost2addr ldap/servers/slapd/daemon.c:2481
    #3 0x556693ef01dd in main (/usr/sbin/ns-slapd+0x2e1dd)
    #4 0x7f1b2cbfd7b2 in __libc_start_main (/lib64/libc.so.6+0x237b2)

Indirect leak of 112 byte(s) in 1 object(s) allocated from:
    #0 0x7f1b3083edb0 in calloc (/lib64/libasan.so.5+0xefdb0)
    #1 0x7f1b302b25a5 in slapi_ch_calloc (/usr/lib64/dirsrv/libslapd.so.0+0xdd5a5)
    #2 0x556693f11707 in slapd_listenhost2addr ldap/servers/slapd/daemon.c:2481
    #3 0x556693ef0100 in main (/usr/sbin/ns-slapd+0x2e100)
    #4 0x7f1b2cbfd7b2 in __libc_start_main (/lib64/libc.so.6+0x237b2)

Indirect leak of 48 byte(s) in 1 object(s) allocated from:
    #0 0x7f1b3083eba8 in __interceptor_malloc (/lib64/libasan.so.5+0xefba8)
    #1 0x7f1b2db8afce  (/lib64/libnspr4.so+0xdfce)

Indirect leak of 40 byte(s) in 1 object(s) allocated from:
    #0 0x7f1b3083eba8 in __interceptor_malloc (/lib64/libasan.so.5+0xefba8)
    #1 0x7f1b2db8afe0  (/lib64/libnspr4.so+0xdfe0)

Indirect leak of 34 byte(s) in 1 object(s) allocated from:
    #0 0x7f1b3078ada0 in strdup (/lib64/libasan.so.5+0x3bda0)
    #1 0x7f1b302b26ad in slapi_ch_strdup (/usr/lib64/dirsrv/libslapd.so.0+0xdd6ad)
    #2 0x556693f0e469 in disk_mon_get_mount_point ldap/servers/slapd/daemon.c:224
    #3 0x556693f0e5e6 in disk_mon_add_dir ldap/servers/slapd/daemon.c:251
    #4 0x556693f0e87d in disk_mon_get_dirs ldap/servers/slapd/daemon.c:285
    #5 0x556693ef2902 in main (/usr/sbin/ns-slapd+0x30902)
    #6 0x7f1b2cbfd7b2 in __libc_start_main (/lib64/libc.so.6+0x237b2)

Indirect leak of 2 byte(s) in 1 object(s) allocated from:
    #0 0x7f1b3078ada0 in strdup (/lib64/libasan.so.5+0x3bda0)
    #1 0x7f1b302b26ad in slapi_ch_strdup (/usr/lib64/dirsrv/libslapd.so.0+0xdd6ad)
    #2 0x556693f0e469 in disk_mon_get_mount_point ldap/servers/slapd/daemon.c:224
    #3 0x556693f0e5e6 in disk_mon_add_dir ldap/servers/slapd/daemon.c:251
    #4 0x556693f0e810 in disk_mon_get_dirs ldap/servers/slapd/daemon.c:277
    #5 0x556693ef2902 in main (/usr/sbin/ns-slapd+0x30902)
    #6 0x7f1b2cbfd7b2 in __libc_start_main (/lib64/libc.so.6+0x237b2)

SUMMARY: AddressSanitizer: 420 byte(s) leaked in 10 allocation(s).

Comment 12 errata-xmlrpc 2020-11-04 03:07:24 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 (389-ds:1.4 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/RHEA-2020:4695


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