Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-65741

LeakSanitizer: memory leak in ldbm_entryrdn.c

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • rhel-9.6
    • rhel-10.0.beta
    • 389-ds-base
    • None
    • No
    • None
    • rhel-sst-idm-ds
    • ssg_idm
    • 0
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • None

      What were you trying to do that didn't work?

      During the tests LeakSanitizer reports memory leak:

      Direct leak of 187647 byte(s) in 79 object(s) allocated from:
          #0 0x7f22bbefc8c7 in malloc (/lib64/libasan.so.8+0xfc8c7) (BuildId: b17f4dcba244e0c6ade7fcec84ffce254acc15b7)
          #1 0x7f22bb79ee97 in slapi_ch_malloc (/usr/lib64/dirsrv/libslapd.so.0+0x19ee97) (BuildId: 29836caa1d665929655ba2782df9df55f64a272f)
          #2 0x7f22b488fac4 in _entryrdn_dup_rdn_elem ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c:1323
          #3 0x7f22b489f775 in entryrdn_insert_key ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c:2483
          #4 0x7f22b4865052 in index_addordel_entry ldap/servers/slapd/back-ldbm/index.c:513
          #5 0x7f22b487ac69 in ldbm_back_add ldap/servers/slapd/back-ldbm/ldbm_add.c:1055
          #6 0x7f22bb7aa70e in op_shared_add ldap/servers/slapd/add.c:759
          #7 0x7f22bb7ad0cd in do_add (/usr/lib64/dirsrv/libslapd.so.0+0x1ad0cd) (BuildId: 29836caa1d665929655ba2782df9df55f64a272f)
          #8 0x564513f7857c in connection_dispatch_operation ldap/servers/slapd/connection.c:639
          #9 0x564513f7857c in connection_threadmain ldap/servers/slapd/connection.c:1921
          #10 0x7f22bc57b3d0 in _pt_root pthreads/../../../../nspr/pr/src/pthreads/ptthread.c:201
          #11 0x7f22bbe5e359 in asan_thread_start ../../../../libsanitizer/asan/asan_interceptors.cpp:234
          #12 0x7f22bb4bd9e8 in start_thread /usr/src/debug/glibc-2.39-22.el10.x86_64/nptl/pthread_create.c:447
          #13 0x7f22bb52d4bb in clone3 ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      
      Direct leak of 187647 byte(s) in 79 object(s) allocated from:
          #0 0x7f22bbefc8c7 in malloc (/lib64/libasan.so.8+0xfc8c7) (BuildId: b17f4dcba244e0c6ade7fcec84ffce254acc15b7)
          #1 0x7f22bb79ee97 in slapi_ch_malloc (/usr/lib64/dirsrv/libslapd.so.0+0x19ee97) (BuildId: 29836caa1d665929655ba2782df9df55f64a272f)
          #2 0x7f22b488fb55 in entryrdn_encode_data ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c:382
          #3 0x7f22b488fc4c in _entryrdn_new_rdn_elem ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c:1311
          #4 0x7f22b4896ccf in _entryrdn_index_read ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c:3124
          #5 0x7f22b48992c6 in entryrdn_index_read_ext (/usr/lib64/dirsrv/plugins/libback-ldbm.so+0x992c6) (BuildId: 0ca3ffdadf5666251f1bc8a2954fb67a2856c0b1)
          #6 0x7f22b4848e79 in dn2entry_ext ldap/servers/slapd/back-ldbm/dn2entry.c:60
          #7 0x7f22b4849748 in get_copy_of_entry ldap/servers/slapd/back-ldbm/dn2entry.c:229
          #8 0x7f22b4876066 in ldbm_back_add ldap/servers/slapd/back-ldbm/ldbm_add.c:323
          #9 0x7f22bb7aa70e in op_shared_add ldap/servers/slapd/add.c:759
          #10 0x7f22bb7ad0cd in do_add (/usr/lib64/dirsrv/libslapd.so.0+0x1ad0cd) (BuildId: 29836caa1d665929655ba2782df9df55f64a272f)
          #11 0x564513f7857c in connection_dispatch_operation ldap/servers/slapd/connection.c:639
          #12 0x564513f7857c in connection_threadmain ldap/servers/slapd/connection.c:1921
          #13 0x7f22bc57b3d0 in _pt_root pthreads/../../../../nspr/pr/src/pthreads/ptthread.c:201
          #14 0x7f22bbe5e359 in asan_thread_start ../../../../libsanitizer/asan/asan_interceptors.cpp:234
          #15 0x7f22bb4bd9e8 in start_thread /usr/src/debug/glibc-2.39-22.el10.x86_64/nptl/pthread_create.c:447
          #16 0x7f22bb52d4bb in clone3 ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      
      Direct leak of 109642 byte(s) in 26 object(s) allocated from:
          #0 0x7f22bbefc8c7 in malloc (/lib64/libasan.so.8+0xfc8c7) (BuildId: b17f4dcba244e0c6ade7fcec84ffce254acc15b7)
          #1 0x7f22bb79ee97 in slapi_ch_malloc (/usr/lib64/dirsrv/libslapd.so.0+0x19ee97) (BuildId: 29836caa1d665929655ba2782df9df55f64a272f)
          #2 0x7f22b488fb55 in entryrdn_encode_data ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c:382
          #3 0x7f22b488fc4c in _entryrdn_new_rdn_elem ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c:1311
          #4 0x7f22b4896ccf in _entryrdn_index_read ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c:3124
          #5 0x7f22b48992c6 in entryrdn_index_read_ext (/usr/lib64/dirsrv/plugins/libback-ldbm.so+0x992c6) (BuildId: 0ca3ffdadf5666251f1bc8a2954fb67a2856c0b1)
          #6 0x7f22b4970d67 in ldbm_ancestorid_index_update.constprop.0 ldap/servers/slapd/back-ldbm/ancestorid.c:127
          #7 0x7f22b482813a in ldbm_ancestorid_index_entry (/usr/lib64/dirsrv/plugins/libback-ldbm.so+0x2813a) (BuildId: 0ca3ffdadf5666251f1bc8a2954fb67a2856c0b1)
          #8 0x7f22b4864e4b in index_addordel_entry ldap/servers/slapd/back-ldbm/index.c:506
          #9 0x7f22b487ac69 in ldbm_back_add ldap/servers/slapd/back-ldbm/ldbm_add.c:1055
          #10 0x7f22bb7aa70e in op_shared_add ldap/servers/slapd/add.c:759
          #11 0x7f22bb7ad0cd in do_add (/usr/lib64/dirsrv/libslapd.so.0+0x1ad0cd) (BuildId: 29836caa1d665929655ba2782df9df55f64a272f)
          #12 0x564513f7857c in connection_dispatch_operation ldap/servers/slapd/connection.c:639
          #13 0x564513f7857c in connection_threadmain ldap/servers/slapd/connection.c:1921
          #14 0x7f22bc57b3d0 in _pt_root pthreads/../../../../nspr/pr/src/pthreads/ptthread.c:201
          #15 0x7f22bbe5e359 in asan_thread_start ../../../../libsanitizer/asan/asan_interceptors.cpp:234
          #16 0x7f22bb4bd9e8 in start_thread /usr/src/debug/glibc-2.39-22.el10.x86_64/nptl/pthread_create.c:447
          #17 0x7f22bb52d4bb in clone3 ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      
      Direct leak of 86559 byte(s) in 61 object(s) allocated from:
          #0 0x7f22bbefc8c7 in malloc (/lib64/libasan.so.8+0xfc8c7) (BuildId: b17f4dcba244e0c6ade7fcec84ffce254acc15b7)
          #1 0x7f22bb79ee97 in slapi_ch_malloc (/usr/lib64/dirsrv/libslapd.so.0+0x19ee97) (BuildId: 29836caa1d665929655ba2782df9df55f64a272f)
          #2 0x7f22b488fb55 in entryrdn_encode_data ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c:382
          #3 0x7f22b488fc4c in _entryrdn_new_rdn_elem ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c:1311
          #4 0x7f22b4896ccf in _entryrdn_index_read ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c:3124
          #5 0x7f22b48992c6 in entryrdn_index_read_ext (/usr/lib64/dirsrv/plugins/libback-ldbm.so+0x992c6) (BuildId: 0ca3ffdadf5666251f1bc8a2954fb67a2856c0b1)
          #6 0x7f22b4848e79 in dn2entry_ext ldap/servers/slapd/back-ldbm/dn2entry.c:60
          #7 0x7f22b4849f37 in find_entry_internal_dn ldap/servers/slapd/back-ldbm/findentry.c:109
          #8 0x7f22b4849f37 in find_entry_internal ldap/servers/slapd/back-ldbm/findentry.c:344
          #9 0x7f22b484ab0a in find_entry ldap/servers/slapd/back-ldbm/findentry.c:362
          #10 0x7f22b48cfffb in ldbm_back_search ldap/servers/slapd/back-ldbm/ldbm_search.c:571
          #11 0x7f22bb86e760 in op_shared_search (/usr/lib64/dirsrv/libslapd.so.0+0x26e760) (BuildId: 29836caa1d665929655ba2782df9df55f64a272f)
          #12 0x564513fa2ab6 in do_search ldap/servers/slapd/search.c:410
          #13 0x564513f784c8 in connection_dispatch_operation ldap/servers/slapd/connection.c:678
          #14 0x564513f784c8 in connection_threadmain ldap/servers/slapd/connection.c:1921
          #15 0x7f22bc57b3d0 in _pt_root pthreads/../../../../nspr/pr/src/pthreads/ptthread.c:201
          #16 0x7f22bbe5e359 in asan_thread_start ../../../../libsanitizer/asan/asan_interceptors.cpp:234
          #17 0x7f22bb4bd9e8 in start_thread /usr/src/debug/glibc-2.39-22.el10.x86_64/nptl/pthread_create.c:447
          #18 0x7f22bb52d4bb in clone3 ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      Please provide the package NVR for which the bug is seen:

      389-ds-base-3.0.4-4.asan.el10.x86_64

      How reproducible is this bug?:

      always

      Steps to reproduce

      1. Install ASan build from https://copr.devel.redhat.com/coprs/ldap-team/rhel10-389-ds-base-asan/
      2. Run dirsrvtests/tests/suites/indexes/entryrdn_test.py

      Expected results

      No memory leak

      Actual results

      ASan reports memory leak

              idm-ds-dev-bugs IdM DS Dev
              vashirov@redhat.com Viktor Ashirov
              IdM DS Dev IdM DS Dev
              IdM DS QE IdM DS QE
              Evgenia Martyniuk Evgenia Martyniuk
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: