krb5 commit: Test bt_split.c unaligned access

Tom Yu tlyu at mit.edu
Thu Sep 8 15:26:45 EDT 2016


https://github.com/krb5/krb5/commit/4613d503986f34f05ff310fcc580f65ba60eec5b
commit 4613d503986f34f05ff310fcc580f65ba60eec5b
Author: Tom Yu <tlyu at mit.edu>
Date:   Wed Sep 7 18:20:56 2016 -0400

    Test bt_split.c unaligned access
    
    ticket: 8493

 src/plugins/kdb/db2/libdb2/test/run.test |   26 ++++++++++++++++++++++++--
 1 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/src/plugins/kdb/db2/libdb2/test/run.test b/src/plugins/kdb/db2/libdb2/test/run.test
index 728a70f..8d92257 100644
--- a/src/plugins/kdb/db2/libdb2/test/run.test
+++ b/src/plugins/kdb/db2/libdb2/test/run.test
@@ -36,7 +36,7 @@ main()
 	find $bindir -type f -exec test -r {} \; -print | head -100 > $BINFILES
 
 	if [ $# -eq 0 ]; then
-		for t in 1 2 3 4 5 6 7 8 9 10 11 12 13 20 40 41 50 60 61 62; do
+		for t in 1 2 3 4 5 6 7 8 9 10 11 12 13 20 40 41 50 60 61 62 63; do
 			test$t
 		done
 	else
@@ -47,7 +47,7 @@ main()
 			[0-9]*)
 				test$1;;
 			btree)
-				for t in 1 2 3 7 8 9 10 12 13 40 41 50 60 61 62; do
+				for t in 1 2 3 7 8 9 10 12 13 40 41 50 60 61 62 63; do
 					test$t
 				done;;
 			hash)
@@ -1009,4 +1009,26 @@ test62 () {
 	done
 }
 
+test63 () {
+	echo "Test 63: btree: big key, medium data, bt_split unaligned access"
+	# 488 = 512 - 20 (header) - 3 ("foo") - 1 (newline)
+	# 223 = 232 - 8 (key pointer)
+	# 232 = bt_ovflsize = (512 - 20 (header)) / 2 (DEFMINKEYPAGE)
+	#	- (2 (indx_t) + 12 (NBLEAFDBT(0,0)))
+	awk 'BEGIN {
+		s = "";
+		for (i = 0; i < 488; i++) {
+			s = s "x";
+		}
+		d = "";
+		for (i = 0; i < 223; i++) {
+			d = d "x";
+		}
+		for (i = 0; i < 128; i++) {
+			printf("p\nk%s%03d\nd%s\n", s, i, d);
+		}
+	}' /dev/null > $TMP2
+	$PROG -o $TMP3 -i psize=512 btree $TMP2
+}
+
 main $*


More information about the cvs-krb5 mailing list