#49644 debug builds crashing in cache_debug_hash()
Closed: wontfix Opened by mreynolds.

Issue Description

Debug builds of 1.4.0 (maybe easriler versions), are crashing when trying to print the entry cache hash.

#0  0x00007f9da937bb0d in malloc_consolidate.part () at /lib64/libc.so.6
#1  0x00007f9da937fb56 in _int_malloc () at /lib64/libc.so.6
#2  0x00007f9da9382cb8 in malloc () at /lib64/libc.so.6
#3  0x00007f9daab1fcd5 in ber_memalloc_x () at /lib64/liblber-2.4.so.2
#4  0x00007f9daab1e42c in ber_realloc () at /lib64/liblber-2.4.so.2
#5  0x00007f9daab1d36b in ber_start_seqorset () at /lib64/liblber-2.4.so.2
#6  0x00007f9daab1dd2c in ber_printf () at /lib64/liblber-2.4.so.2
#7  0x00007f9dac00f33a in send_ldap_result_ext (pb=0x7f9d1c0008c0, err=0, matched=0x0, text=0x0, nentries=223, urls=0x0, ber=0x7f9d1c0bcf70)
    at ../389-ds-base/ldap/servers/slapd/result.c:499
#8  0x00007f9dac00e961 in send_ldap_result (pb=0x7f9d1c0008c0, err=0, matched=0x0, text=0x0, nentries=223, urls=0x0)
    at ../389-ds-base/ldap/servers/slapd/result.c:199
#9  0x00007f9dabfe624c in op_shared_search (pb=0x7f9d1c0008c0, send_result=1) at ../389-ds-base/ldap/servers/slapd/opshared.c:946
#10 0x0000000000434fef in do_search (pb=0x7f9d1c0008c0) at ../389-ds-base/ldap/servers/slapd/search.c:335
#11 0x0000000000417151 in connection_dispatch_operation (conn=0x250d080, op=0x7f9d8c00a4d0, pb=0x7f9d1c0008c0)
    at ../389-ds-base/ldap/servers/slapd/connection.c:649
#12 0x0000000000419109 in connection_threadmain () at ../389-ds-base/ldap/servers/slapd/connection.c:1779

valgrind shows:

==13168== Thread 59:
==13168== Invalid read of size 4
==13168==    at 0x127E55DD: cache_debug_hash (cache.c:837)
==13168==    by 0x128597AF: ldbm_back_monitor_instance_search (monitor.c:130)
==13168==    by 0x50AEDD9: dse_call_callback (dse.c:2551)
==13168==    by 0x50AC6A0: do_dse_search (dse.c:1567)
==13168==    by 0x50ACAFA: dse_search (dse.c:1676)
==13168==    by 0x50F3AA5: op_shared_search (opshared.c:763)
==13168==    by 0x435073: do_search (search.c:335)
==13168==    by 0x417150: connection_dispatch_operation (connection.c:649)
==13168==    by 0x419108: connection_threadmain (connection.c:1779)
==13168==    by 0x737F07A: ??? (in /usr/lib64/libnspr4.so)
==13168==    by 0x77B936C: start_thread (in /usr/lib64/libpthread-2.25.so)
==13168==    by 0x7D2AB4E: clone (in /usr/lib64/libc-2.25.so)
==13168==  Address 0x4f5ddd98 is 0 bytes after a block of size 200 alloc'd
==13168==    at 0x4C2DB6B: malloc (vg_replace_malloc.c:299)
==13168==    by 0x509C157: slapi_ch_malloc (ch_malloc.c:95)
==13168==    by 0x127E46C5: hash_stats (cache.c:311)
==13168==    by 0x127E557B: cache_debug_hash (cache.c:830)
==13168==    by 0x128597AF: ldbm_back_monitor_instance_search (monitor.c:130)
==13168==    by 0x50AEDD9: dse_call_callback (dse.c:2551)
==13168==    by 0x50AC6A0: do_dse_search (dse.c:1567)
==13168==    by 0x50ACAFA: dse_search (dse.c:1676)
==13168==    by 0x50F3AA5: op_shared_search (opshared.c:763)
==13168==    by 0x435073: do_search (search.c:335)
==13168==    by 0x417150: connection_dispatch_operation (connection.c:649)
==13168==    by 0x419108: connection_threadmain (connection.c:1779)
==13168==    by 0x737F07A: ??? (in /usr/lib64/libnspr4.so)
==13168==    by 0x77B936C: start_thread (in /usr/lib64/libpthread-2.25.so)
==13168==    by 0x7D2AB4E: clone (in /usr/lib64/libc-2.25.so)

Problem is an uninitialized pointer - simple fix...


1e0b18a08..5bfc18a24 master -> master

acd3a91d6..8505cb8be 389-ds-base-1.3.8 -> 389-ds-base-1.3.8

e82bba7e9..f0eaa2a4c 389-ds-base-1.3.7 -> 389-ds-base-1.3.7

92c4c2a68..02f502a6c 389-ds-base-1.3.6 -> 389-ds-base-1.3.6

Metadata Update from @mreynolds:
- Custom field component adjusted to None
- Custom field origin adjusted to None
- Custom field reviewstatus adjusted to None
- Custom field type adjusted to None
- Custom field version adjusted to None
- Issue close_status updated to: fixed
- Issue set to the milestone: 1.3.6.0 (was: 1.3.7.0)
- Issue status updated to: Closed (was: Open)

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This issue has been cloned to Github and is available here:
- https://github.com/389ds/389-ds-base/issues/2703

If you want to receive further updates on the issue, please navigate to the github issue
and click on subscribe button.

Thank you for understanding. We apologize for all inconvenience.

Metadata Update from @spichugi:
- Issue close_status updated to: wontfix (was: fixed)

Metadata