#49104 dbscan-bin crashing due to a segmentation fault.
Closed: Fixed None Opened 2 years ago by nhosoi.

Description of problem:

A customer needed to get the number of entries in a given DB.
Based on this article we asked him to run dbscan:
https://github.com/richm/scripts/wiki/dbmon.sh

But dbscan is crashing in the customer environment.

Version-Release number of selected component (if applicable):

389 1.2.11.15-84.

How reproducible:

Steps to Reproduce:

For instance,
# dbscan -f /var/lib/dirsrv/slapd-389/db/customer/id2entry.db4  -t 200 >
slapd-389_customer.txt
/usr/bin/dbscan: line 51: 28783 Segmentation fault      (core dumped)
${dir}/${COMMAND} "$@"
#

Invalid read/write reported by valgrind.
==21395== Invalid write of size 1
==21395==    at 0x400F60: format_raw (dbscan.c:266)
==21395==    by 0x401919: format (dbscan.c:272)
==21395==    by 0x401919: display_item (dbscan.c:769)
==21395==    by 0x402FF7: main (dbscan.c:1295)
==21395==  Address 0x4c60de8 is 0 bytes after a block of size 200 alloc'd
==21395==    at 0x4A07208: malloc (in /opt/rh/devtoolset-3/root/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==21395==    by 0x4A0737C: realloc (in /opt/rh/devtoolset-3/root/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==21395==    by 0x401964: display_item (dbscan.c:733)
==21395==    by 0x402FF7: main (dbscan.c:1295)
==21395== 
==21395== Invalid read of size 1
==21395==    at 0x35E1247E2C: vfprintf (in /lib64/libc-2.12.so)
==21395==    by 0x35E12FFC10: __printf_chk (in /lib64/libc-2.12.so)
==21395==    by 0x402FF7: main (dbscan.c:1295)
==21395==  Address 0x4c60de8 is 0 bytes after a block of size 200 alloc'd
==21395==    at 0x4A07208: malloc (in /opt/rh/devtoolset-3/root/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==21395==    by 0x4A0737C: realloc (in /opt/rh/devtoolset-3/root/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==21395==    by 0x401964: display_item (dbscan.c:733)
==21395==    by 0x402FF7: main (dbscan.c:1295)

See also: https://bugzilla.redhat.com/show_bug.cgi?id=1408976#c15

git patch file (lib389) - Support additional options (-t truncate -R)
0001-dbscan-Support-additional-options-t-truncate-R.patch

I'm happy with the fix. The test may have issue if we don't have valgrind installed (or has been built with asan). However, that sounds like a whole lot of "my problem only", so I will ack this, and when I encounter the issue I'll fix it myself then.

Thanks for your work!

Thanks for reviewing the patches, William!

It implies you did not have valgrind? ;) If we run the test suites on a newly allocated VM, that'd happen easily, indeed...:( Since lib389 has a test API which uses valgrind, we may want to add "Require valgrind" to the lib389 spec file? Of course, that does not solve all the cases, but it might reduce the number (hopefully)...

Reviewed by William (Thank you!!)

Pushed to master:
e998632..c5a67ce master -> master
commit efeb2f6
commit c5a67ce

Pushed to 389-ds-base-1.3.5:
3ac12cb..db458b4 389-ds-base-1.3.5 -> 389-ds-base-1.3.5
commit 3e3bcee
commit db458b4

Pushed to 389-ds-base-1.2.11:
90702d1..b73428c 389-ds-base-1.2.11 -> 389-ds-base-1.2.11
commit 93946f9
commit b73428c

Metadata Update from @nhosoi:
- Issue assigned to nhosoi
- Issue set to the milestone: 1.2.11.33

2 years ago

Login to comment on this ticket.

Metadata