[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

valgrind warning in BDB locks code

From: Philip Martin <philip.martin_at_wandisco.com>
Date: Thu, 24 Nov 2011 11:36:24 +0000

$ valgrind -q .libs/lt-locks-test 4 --fs-type bdb
==15971== Invalid read of size 1
==15971== at 0x4C25CF3: strncmp (mc_replace_strmem.c:398)
==15971== by 0x652BA6A: svn_fs_bdb__locks_get (locks-table.c:257)
==15971== by 0x653A0F0: txn_body_get_locks (lock.c:440)
==15971== by 0x654125E: do_retry (trail.c:213)
==15971== by 0x654143F: svn_fs_base__retry_txn (trail.c:278)
==15971== by 0x653A26F: svn_fs_base__get_locks (lock.c:468)
==15971== by 0x5039205: svn_fs_get_locks2 (fs-loader.c:1252)
==15971== by 0x5039276: svn_fs_get_locks (fs-loader.c:1262)
==15971== by 0x4028AF: get_locks (locks-test.c:344)
==15971== by 0x4E2EFB7: do_test_num (svn_test_main.c:265)
==15971== by 0x4E2F9FE: main (svn_test_main.c:532)
==15971== Address 0x85266cc is 0 bytes after a block of size 12 alloc'd
==15971== at 0x4C244E8: malloc (vg_replace_malloc.c:236)
==15971== by 0x7BCEB04: __os_umalloc (in /usr/lib/libdb-4.8.so)
==15971== by 0x7B92C15: __db_retcopy (in /usr/lib/libdb-4.8.so)
==15971== by 0x7B92D7B: __db_ret (in /usr/lib/libdb-4.8.so)
==15971== by 0x7B7368E: __dbc_iget (in /usr/lib/libdb-4.8.so)
==15971== by 0x7B7D0AE: __dbc_get_pp (in /usr/lib/libdb-4.8.so)
==15971== by 0x652B7BF: svn_fs_bdb__locks_get (locks-table.c:248)
==15971== by 0x653A0F0: txn_body_get_locks (lock.c:440)
==15971== by 0x654125E: do_retry (trail.c:213)
==15971== by 0x654143F: svn_fs_base__retry_txn (trail.c:278)
==15971== by 0x653A26F: svn_fs_base__get_locks (lock.c:468)
==15971== by 0x5039205: svn_fs_get_locks2 (fs-loader.c:1252)

    at ../src/subversion/libsvn_fs_base/bdb/locks-table.c:257
257 && strncmp(lookup_path, key.data, strlen(lookup_path)) == 0)
(gdb) p lookup_path
$1 = 0x8526790 "/A/D/H/omega/"
(gdb) p (char*)key.data
$2 = 0x85266c0 "/A/D/H/omega"
(gdb) p key.size
$3 = 12

strlen(lookup_path) is 13 and while key.data appears to be null
terminated, so that the null would be the thirteenth byte, the key.size
is only 12.

-- 
uberSVN: Apache Subversion Made Easy
http://www.uberSVN.com
Received on 2011-11-24 12:37:06 CET

This is an archived mail posted to the Subversion Dev mailing list.