Bug 1139309

Summary: Memory leak in libplc4.so, used by openldap
Product: Red Hat Enterprise Linux 7 Reporter: David Spurek <dspurek>
Component: openldapAssignee: Matus Honek <mhonek>
Status: CLOSED WONTFIX QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: high Docs Contact:
Priority: high    
Version: 7.0CC: databases-maint, emaldona, hkario, jstanek, kengert, ksrot, nmavrogi, pkis, qe-baseos-daemons, rrelyea
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 917543 Environment:
Last Closed: 2016-10-10 19:10:32 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: 917543    
Bug Blocks: 1205796    

Description David Spurek 2014-09-08 15:37:08 UTC
I see the same problem in rhel7 with libdb-5.3.21-17.el7 and openldap-2.4.39-3.el7
+++ This bug was initially created as a clone of Bug #917543 +++

Description of problem:
Memory leak in libdb-4.7.so, used by openldap

Version-Release number of selected component (if applicable):
db4-4.7.25-17.el6
openldap-2.4.23-31.el6

How reproducible:
always

Steps to Reproduce:
1.run reproducer script
2.
3.
  
Actual results:
some definitely lost leaks found

Expected results:
no leaks


Additional info:

==23876== Memcheck, a memory error detector
==23876== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==23876== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==23876== Command: /usr/sbin/slapd -u ldap -h ldap://127.0.0.1:3890 -f slapd-master.conf
==23876== Parent PID: 23430
==23876== 
==23876== 
==23876== HEAP SUMMARY:
==23876==     in use at exit: 410,816 bytes in 7,512 blocks
==23876==   total heap usage: 12,536 allocs, 5,024 frees, 905,054 bytes allocated
==23876== 
==23876== LEAK SUMMARY:
==23876==    definitely lost: 27 bytes in 1 blocks
==23876==    indirectly lost: 0 bytes in 0 blocks
==23876==      possibly lost: 0 bytes in 0 blocks
==23876==    still reachable: 410,789 bytes in 7,511 blocks
==23876==         suppressed: 0 bytes in 0 blocks
==23876== Rerun with --leak-check=full to see details of leaked memory
==23876== 
==23876== For counts of detected and suppressed errors, rerun with: -v
==23876== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 36 from 9)
==23876== could not unlink /tmp/vgdb-pipe-from-vgdb-to-23876-by-root-on-rhel64
==23876== could not unlink /tmp/vgdb-pipe-to-vgdb-from-23876-by-root-on-rhel64
==23876== could not unlink /tmp/vgdb-pipe-shared-mem-vgdb-23876-by-root-on-rhel64
==23878== Thread 3:
==23878== Conditional jump or move depends on uninitialised value(s)
==23878==    at 0x514FDC8: ??? (in /lib64/libdb-4.7.so)
==23878==    by 0x5150BA8: __log_put (in /lib64/libdb-4.7.so)
==23878==    by 0x5106E68: __db_addrem_log (in /lib64/libdb-4.7.so)
==23878==    by 0x5114147: __db_pitem (in /lib64/libdb-4.7.so)
==23878==    by 0x506B5FA: ??? (in /lib64/libdb-4.7.so)
==23878==    by 0x506CC5B: __bam_iitem (in /lib64/libdb-4.7.so)
==23878==    by 0x5067237: ??? (in /lib64/libdb-4.7.so)
==23878==    by 0x5110A82: __dbc_put (in /lib64/libdb-4.7.so)
==23878==    by 0x5115FC0: __dbc_put_pp (in /lib64/libdb-4.7.so)
==23878==    by 0x20B9F6: bdb_idl_insert_key (in /usr/sbin/slapd)
==23878==    by 0x205E96: bdb_dn2id_add (in /usr/sbin/slapd)
==23878==    by 0x1FD37B: bdb_add (in /usr/sbin/slapd)
==23878== 
==23878== Syscall param pwrite64(buf) points to uninitialised byte(s)
==23878==    at 0x6A33EC3: ??? (in /lib64/libpthread-2.12.so)
==23878==    by 0x5165120: __os_io (in /lib64/libdb-4.7.so)
==23878==    by 0x514EB04: ??? (in /lib64/libdb-4.7.so)
==23878==    by 0x514F7C7: __log_flush_int (in /lib64/libdb-4.7.so)
==23878==    by 0x5151024: __log_put (in /lib64/libdb-4.7.so)
==23878==    by 0x5170257: __txn_regop_log (in /lib64/libdb-4.7.so)
==23878==    by 0x516CF22: __txn_commit (in /lib64/libdb-4.7.so)
==23878==    by 0x516CFAE: ??? (in /lib64/libdb-4.7.so)
==23878==    by 0x1FDA31: bdb_add (in /usr/sbin/slapd)
==23878==    by 0x1BE976: overlay_op_walk (in /usr/sbin/slapd)
==23878==    by 0x1BF3CA: ??? (in /usr/sbin/slapd)
==23878==    by 0x15A38F: fe_op_add (in /usr/sbin/slapd)
==23878==  Address 0x40a8f9c is not stack'd, malloc'd or (recently) free'd
==23878== 
==23878== Conditional jump or move depends on uninitialised value(s)
==23878==    at 0x514FDC8: ??? (in /lib64/libdb-4.7.so)
==23878==    by 0x5150BA8: __log_put (in /lib64/libdb-4.7.so)
==23878==    by 0x508A198: __bam_split_log (in /lib64/libdb-4.7.so)
==23878==    by 0x5079468: __bam_split (in /lib64/libdb-4.7.so)
==23878==    by 0x5067306: ??? (in /lib64/libdb-4.7.so)
==23878==    by 0x5110A82: __dbc_put (in /lib64/libdb-4.7.so)
==23878==    by 0x510283B: __db_put (in /lib64/libdb-4.7.so)
==23878==    by 0x5117632: __db_put_pp (in /lib64/libdb-4.7.so)
==23878==    by 0x205BBB: bdb_dn2id_add (in /usr/sbin/slapd)
==23878==    by 0x1FD37B: bdb_add (in /usr/sbin/slapd)
==23878==    by 0x1BE976: overlay_op_walk (in /usr/sbin/slapd)
==23878==    by 0x1BF3CA: ??? (in /usr/sbin/slapd)
==23878== 
==23878== Thread 5:
==23878== Syscall param pwrite64(buf) points to uninitialised byte(s)
==23878==    at 0x6A33EC3: ??? (in /lib64/libpthread-2.12.so)
==23878==    by 0x5165120: __os_io (in /lib64/libdb-4.7.so)
==23878==    by 0x51537A3: ??? (in /lib64/libdb-4.7.so)
==23878==    by 0x5153A04: __memp_bhwrite (in /lib64/libdb-4.7.so)
==23878==    by 0x515275D: __memp_alloc (in /lib64/libdb-4.7.so)
==23878==    by 0x51544C2: __memp_fget (in /lib64/libdb-4.7.so)
==23878==    by 0x5075D84: __bam_search (in /lib64/libdb-4.7.so)
==23878==    by 0x50648F5: ??? (in /lib64/libdb-4.7.so)
==23878==    by 0x50650A6: ??? (in /lib64/libdb-4.7.so)
==23878==    by 0x510D97D: __dbc_get (in /lib64/libdb-4.7.so)
==23878==    by 0x511691C: __dbc_get_pp (in /lib64/libdb-4.7.so)
==23878==    by 0x209664: bdb_id2entry (in /usr/sbin/slapd)
==23878==  Address 0x407b680 is not stack'd, malloc'd or (recently) free'd
==23878== 
==23878== 
==23878== HEAP SUMMARY:
==23878==     in use at exit: 138,555 bytes in 3,345 blocks
==23878==   total heap usage: 1,483,253 allocs, 1,479,908 frees, 453,643,587 bytes allocated
==23878== 
==23878== LEAK SUMMARY:
==23878==    definitely lost: 130,507 bytes in 3,260 blocks
==23878==    indirectly lost: 0 bytes in 0 blocks
==23878==      possibly lost: 0 bytes in 0 blocks
==23878==    still reachable: 8,048 bytes in 85 blocks
==23878==         suppressed: 0 bytes in 0 blocks
==23878== Rerun with --leak-check=full to see details of leaked memory
==23878== 
==23878== For counts of detected and suppressed errors, rerun with: -v
==23878== Use --track-origins=yes to see where uninitialised values come from
==23878== ERROR SUMMARY: 10 errors from 4 contexts (suppressed: 36 from 9)

--- Additional comment from Jan Staněk on 2013-05-29 09:00:17 EDT ---

When tested in current RHEL6 (same versions of the packages), valgrind reports some still-reachable leaks directly in /usr/sbin/slapd, and none definitely lost leaks.

It seems to me that this bug is fixed in current RHEL6.

--- Additional comment from RHEL Product and Program Management on 2013-10-13 19:53:23 EDT ---

This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unable to address this
request at this time.

Red Hat invites you to ask your support representative to
propose this request, if appropriate, in the next release of
Red Hat Enterprise Linux.

Comment 1 David Spurek 2014-09-08 15:40:47 UTC
==3334== Memcheck, a memory error detector
==3334== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==3334== Using Valgrind-3.9.0 and LibVEX; rerun with -h for copyright info
==3334== Command: /usr/sbin/slapd -u ldap -h ldap://127.0.0.1:3890 -f slapd-master.conf
==3334== Parent PID: 2194
==3334== 
==3334== 
==3334== HEAP SUMMARY:
==3334==     in use at exit: 388,475 bytes in 7,238 blocks
==3334==   total heap usage: 12,224 allocs, 4,986 frees, 942,815 bytes allocated
==3334== 
==3334== LEAK SUMMARY:
==3334==    definitely lost: 27 bytes in 1 blocks
==3334==    indirectly lost: 0 bytes in 0 blocks
==3334==      possibly lost: 0 bytes in 0 blocks
==3334==    still reachable: 388,448 bytes in 7,237 blocks
==3334==         suppressed: 0 bytes in 0 blocks
==3334== Rerun with --leak-check=full to see details of leaked memory
==3334== 
==3334== For counts of detected and suppressed errors, rerun with: -v
==3334== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 3 from 3)
==3334== could not unlink /tmp/vgdb-pipe-from-vgdb-to-3334-by-root-on-pes-guest-89.lab.eng.brq.redhat.com
==3334== could not unlink /tmp/vgdb-pipe-to-vgdb-from-3334-by-root-on-pes-guest-89.lab.eng.brq.redhat.com
==3334== could not unlink /tmp/vgdb-pipe-shared-mem-vgdb-3334-by-root-on-pes-guest-89.lab.eng.brq.redhat.com
==3352== Thread 3:
==3352== Conditional jump or move depends on uninitialised value(s)
==3352==    at 0x53DDE7D: ??? (in /usr/lib64/libdb-5.3.so)
==3352==    by 0x53DF587: __log_put (in /usr/lib64/libdb-5.3.so)
==3352==    by 0x53E0A0B: ??? (in /usr/lib64/libdb-5.3.so)
==3352==    by 0x53E183F: __log_put_record (in /usr/lib64/libdb-5.3.so)
==3352==    by 0x5399D52: __db_pitem (in /usr/lib64/libdb-5.3.so)
==3352==    by 0x52DCD1D: ??? (in /usr/lib64/libdb-5.3.so)
==3352==    by 0x52DE8F5: __bam_iitem (in /usr/lib64/libdb-5.3.so)
==3352==    by 0x52D9624: ??? (in /usr/lib64/libdb-5.3.so)
==3352==    by 0x53903E3: __dbc_iput (in /usr/lib64/libdb-5.3.so)
==3352==    by 0x539F220: __dbc_put_pp (in /usr/lib64/libdb-5.3.so)
==3352==    by 0x213C88: bdb_idl_insert_key (in /usr/sbin/slapd)
==3352==    by 0x20DA14: bdb_dn2id_add (in /usr/sbin/slapd)
==3352== 
==3352== Syscall param pwrite64(buf) points to uninitialised byte(s)
==3352==    at 0x5BCAB23: ??? (in /usr/lib64/libpthread-2.17.so)
==3352==    by 0x53F8E38: __os_io (in /usr/lib64/libdb-5.3.so)
==3352==    by 0x53DDB81: ??? (in /usr/lib64/libdb-5.3.so)
==3352==    by 0x53DE9E7: __log_flush_int (in /usr/lib64/libdb-5.3.so)
==3352==    by 0x53DF97C: __log_put (in /usr/lib64/libdb-5.3.so)
==3352==    by 0x53E0A0B: ??? (in /usr/lib64/libdb-5.3.so)
==3352==    by 0x53E183F: __log_put_record (in /usr/lib64/libdb-5.3.so)
==3352==    by 0x5404158: __txn_commit (in /usr/lib64/libdb-5.3.so)
==3352==    by 0x540423F: ??? (in /usr/lib64/libdb-5.3.so)
==3352==    by 0x20677C: bdb_add (in /usr/sbin/slapd)
==3352==    by 0x1BA195: overlay_op_walk (in /usr/sbin/slapd)
==3352==    by 0x1BA2FA: ??? (in /usr/sbin/slapd)
==3352==  Address 0x40401cc is not stack'd, malloc'd or (recently) free'd
==3352== 
==3352== Thread 4:
==3352== Conditional jump or move depends on uninitialised value(s)
==3352==    at 0x52E8D84: __bam_stkrel (in /usr/lib64/libdb-5.3.so)
==3352==    by 0x52D97CE: ??? (in /usr/lib64/libdb-5.3.so)
==3352==    by 0x53905A4: __dbc_iput (in /usr/lib64/libdb-5.3.so)
==3352==    by 0x539F220: __dbc_put_pp (in /usr/lib64/libdb-5.3.so)
==3352==    by 0x213C88: bdb_idl_insert_key (in /usr/sbin/slapd)
==3352==    by 0x20DA14: bdb_dn2id_add (in /usr/sbin/slapd)
==3352==    by 0x206109: bdb_add (in /usr/sbin/slapd)
==3352==    by 0x1BA195: overlay_op_walk (in /usr/sbin/slapd)
==3352==    by 0x1BA2FA: ??? (in /usr/sbin/slapd)
==3352==    by 0x15258F: fe_op_add (in /usr/sbin/slapd)
==3352==    by 0x15351F: do_add (in /usr/sbin/slapd)
==3352==    by 0x14B71B: ??? (in /usr/sbin/slapd)
==3352== 
==3352== Thread 3:
==3352== Syscall param pwrite64(buf) points to uninitialised byte(s)
==3352==    at 0x5BCAB23: ??? (in /usr/lib64/libpthread-2.17.so)
==3352==    by 0x53F8E38: __os_io (in /usr/lib64/libdb-5.3.so)
==3352==    by 0x53E4748: ??? (in /usr/lib64/libdb-5.3.so)
==3352==    by 0x53E4B85: __memp_bhwrite (in /usr/lib64/libdb-5.3.so)
==3352==    by 0x53E2FD3: __memp_alloc (in /usr/lib64/libdb-5.3.so)
==3352==    by 0x53E6763: __memp_fget (in /usr/lib64/libdb-5.3.so)
==3352==    by 0x52EA120: __bam_search (in /usr/lib64/libdb-5.3.so)
==3352==    by 0x52D5175: ??? (in /usr/lib64/libdb-5.3.so)
==3352==    by 0x52D6C2E: ??? (in /usr/lib64/libdb-5.3.so)
==3352==    by 0x538FB75: __dbc_iget (in /usr/lib64/libdb-5.3.so)
==3352==    by 0x539E9F1: __dbc_get_pp (in /usr/lib64/libdb-5.3.so)
==3352==    by 0x211689: bdb_id2entry (in /usr/sbin/slapd)
==3352==  Address 0x418c858 is not stack'd, malloc'd or (recently) free'd
==3352== 
==3352== 
==3352== HEAP SUMMARY:
==3352==     in use at exit: 8,092 bytes in 87 blocks
==3352==   total heap usage: 1,470,551 allocs, 1,470,464 frees, 389,886,724 bytes allocated
==3352== 
==3352== LEAK SUMMARY:
==3352==    definitely lost: 27 bytes in 1 blocks
==3352==    indirectly lost: 0 bytes in 0 blocks
==3352==      possibly lost: 0 bytes in 0 blocks
==3352==    still reachable: 8,065 bytes in 86 blocks
==3352==         suppressed: 0 bytes in 0 blocks
==3352== Rerun with --leak-check=full to see details of leaked memory
==3352== 
==3352== For counts of detected and suppressed errors, rerun with: -v
==3352== Use --track-origins=yes to see where uninitialised values come from
==3352== ERROR SUMMARY: 77 errors from 4 contexts (suppressed: 3 from 3)

Comment 17 Red Hat Bugzilla 2023-09-14 02:47:10 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days