Description of problem: Question from Community: I found a file called dbtest.c in fds source code. The actual purpose the file written is - “ldbm database test program”. (from the comment inside file) The function dbtest_help() inside the dbtest.c clearly shows some command line help messages such as i => traverse index keys and ID list values" t => traverse index keys and values" ; T => traverse index keys"; u => traverse id2entry keys and values" ; U => traverse id2entry keys"; l<c> => lookup index"; L<c> => lookup index (all)"; t<c> => traverse index keys… etc, But I could not find any specific tool which uses the functions which exists inside dbtest.c. I tried using all the available tools in FDS I didn’t find any tool which invokes this dbtest_help () function. Other than dbverify, dbscan, is there really any testing tool available for database testing OR This file is in the source code as an intention of using it in future FDS releases. Can somebody clarify my doubt? ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1) Stop the server 2) Run the command line. Then, I put "i" to dbtest, then "sn" to attr: # /usr/sbin/ns-slapd dbtest -D /etc/dirsrv/slapd-your_instance_name -n userRoot ldbm database test mode index key prefixes: + presence (sn=*) = equality (sn=jensen) ~ approximate (sn~=jensin) * substring (sn=jen*) : matching rule (sn:1.2.3.4.5:=Jensen) \ continuation commands: i => traverse index keys and ID list values t => traverse index keys and values T => traverse index keys u => traverse id2entry keys and values U => traverse id2entry keys dbtest: i attr: sn key: * al data: Regular block (count=60, max=1202) id: 18482912 id: 0 id: 32 id: 0 id: 49 id: 0 id: 18891783 But it eventually crashed on my test machine. [Stacktrace] Program received signal SIGSEGV, Segmentation fault. 0x00007f3143fc42c5 in dbtest_print_idlist (keystr=0x179b1c0 "* an", p=0x17acf20, size=4, outfp=0x3c1cb66780) at ldap/servers/slapd/back-ldbm/dbtest.c:280 280 for ( i = 0; idl->b_ids[i] != NOID; ++i ) { (gdb) bt #0 0x00007f3143fc42c5 in dbtest_print_idlist (keystr=0x179b1c0 "* an", p=0x17acf20, size=4, outfp=0x3c1cb66780) at ldap/servers/slapd/back-ldbm/dbtest.c:280 #1 0x00007f3143fc4167 in dbtest_traverse (db=0x17a1930, filename=0x7fff4dcc8510 "sn", options=13, outfp=0x3c1cb66780) at ldap/servers/slapd/back-ldbm/dbtest.c:254 #2 0x00007f3143fc3e35 in ldbm_back_db_test (pb=0x7fff4dcc8630) at ldap/servers/slapd/back-ldbm/dbtest.c:147 #3 0x0000000000420c99 in slapd_exemode_dbtest () at ldap/servers/slapd/main.c:2748 #4 0x000000000041d1ac in main (argc=6, argv=0x7fff4dcc8cc8) at ldap/servers/slapd/main.c:951 (gdb) p i $1 = 128054 (gdb) p idl->b_ids[i] Cannot access memory at address 0x182a000
Created attachment 455193 [details] git patch file (master) Description: Getting rid of the dbtest.c file and its command line option in main.c. The tool is obsolete (new idl format is not supported). Files: Makefile.am ldap/servers/slapd/back-ldbm/dbtest.c ldap/servers/slapd/back-ldbm/init.c ldap/servers/slapd/back-ldbm/proto-back-ldbm.h ldap/servers/slapd/main.c
Reviewed by Rich and Nathan (Thanks a lot!) Pushed to master. $ git merge work Updating 07f9ed2..5fb379f Fast-forward Makefile.am | 1 - Makefile.in | 16 +- aclocal.m4 | 4 +- config.h.in | 6 + configure |14450 ++++++++---------------- ldap/servers/slapd/back-ldbm/dbtest.c | 349 - ldap/servers/slapd/back-ldbm/init.c | 2 - ldap/servers/slapd/back-ldbm/proto-back-ldbm.h | 1 - ldap/servers/slapd/main.c | 74 - 9 files changed, 4911 insertions(+), 9992 deletions(-) delete mode 100644 ldap/servers/slapd/back-ldbm/dbtest.c $ git push Counting objects: 27, done. Delta compression using up to 4 threads. Compressing objects: 100% (14/14), done. Writing objects: 100% (14/14), 36.20 KiB, done. Total 14 (delta 11), reused 1 (delta 0) To ssh://git.fedorahosted.org/git/389/ds.git 07f9ed2..5fb379f master -> master
Hi Noriko, It seems that this bug is for the source code changes in the dbtest.c file. Can you please guide, how should I verify this. Thanks, Amita
(In reply to comment #4) > Hi Noriko, > > It seems that this bug is for the source code changes in the dbtest.c file. > Can you please guide, how should I verify this. > > Thanks, > Amita Hi, Amita. The server binary used to take "dbtest" as an option for testing db, but it was gotten rid of by this bug fix. For instance, db2ldif could be run like this: /usr/sbin/ns-slapd db2ldif -D /etc/dirsrv/slapd-ID -n userRoot -a /path/to/output In the same way, we used to be able to set dbtest like this: /usr/sbin/ns-slapd dbtest D /etc/dirsrv/slapd-ID -n userRoot Now it just issues this usage. That is, "dbtest" was dropped. usage: ns-slapd -D configdir [ldif2db | db2ldif | archive2db | db2archive | db2index | refer | suffix2instance | upgradedb | upgradednformat | dbverify] [options]
[root@testvm amsharma]# /usr/sbin/ns-slapd dbtest -D /etc/dirsrv/slapd-testvm/ -n userRoot usage: ns-slapd -D configdir [ldif2db | db2ldif | archive2db | db2archive | db2index | refer | suffix2instance | upgradedb | upgradednformat | dbverify] [options] [root@testvm amsharma]# locate dbtest /usr/share/doc/dstat-0.7.0/examples/tdbtest [root@testvm amsharma]# find / -name dbtest Yes, It is removed. Marking the bug as VERIFIED.