[Pkg-db-devel] Bug#437742: db: Encryption broken on arm (old ABI)
Ben Hutchings
ben at decadent.org.uk
Tue Sep 9 22:27:05 UTC 2008
With this change, test env007 passes on arm.
I found another failing test, env012. This is timing-dependent and
possibly ought to be excluded. Increasing the delay in it from 2 to 4
seconds made it pass (and doesn't appear to invalidate the test case).
I intend to NMU once I've completed a build on arm. Diff follows.
Ben.
diff -u db-4.7.25/debian/rules db-4.7.25/debian/rules
--- db-4.7.25/debian/rules
+++ db-4.7.25/debian/rules
@@ -65,7 +65,7 @@
CONFIGURE_VARS += STRIP=":"
endif
-BROKEN_ARCHES = zarmz zsparcz zs390z
+BROKEN_ARCHES = zsparcz zs390z
VERY_BROKEN_ARCHES = zm68kz zhppaz
package=db4.7
diff -u db-4.7.25/debian/changelog db-4.7.25/debian/changelog
--- db-4.7.25/debian/changelog
+++ db-4.7.25/debian/changelog
@@ -1,3 +1,16 @@
+db (4.7.25-3.1) unstable; urgency=low
+
+ * Non-maintainer upload.
+ * Fixed two bugs affecting arm and possibly other architectures:
+ - Encrypted databases were unusable due to unexpected structure
+ padding. Excluded this padding from size calculations.
+ closes: #437742
+ - Test env012.b includes a delay to allow one child process to
+ open a database before the second starts. Increased this from
+ 2 to 4 seconds.
+
+ -- Ben Hutchings <ben at decadent.org.uk> Tue, 09 Sep 2008 22:46:39 +0100
+
db (4.7.25-3) unstable; urgency=low
* Add more conflicts to libdb4.7-dev. closes: #486318.
only in patch2:
unchanged:
--- db-4.7.25.orig/dbinc/db_page.h
+++ db-4.7.25/dbinc/db_page.h
@@ -223,6 +223,17 @@
*/
} PG_CRYPTO;
+/*
+ * With most compilers sizeof(PG_CRYPTO) == 38. However some ABIs
+ * require it to be padded to 40 bytes. The padding must be excluded
+ * from our size calculations due to the 16-byte alignment requirement
+ * for crypto.
+ *
+ * A similar problem applies to PG_CHKSUM, but it's too late to change
+ * that.
+ */
+#define SIZEOF_PG_CRYPTO 38
+
typedef struct _db_page {
DB_LSN lsn; /* 00-07: Log sequence number. */
db_pgno_t pgno; /* 08-11: Current page number. */
@@ -258,7 +269,7 @@
*/
#define P_INP(dbp, pg) \
((db_indx_t *)((u_int8_t *)(pg) + SIZEOF_PAGE + \
- (F_ISSET((dbp), DB_AM_ENCRYPT) ? sizeof(PG_CRYPTO) : \
+ (F_ISSET((dbp), DB_AM_ENCRYPT) ? SIZEOF_PG_CRYPTO : \
(F_ISSET((dbp), DB_AM_CHKSUM) ? sizeof(PG_CHKSUM) : 0))))
#define P_IV(dbp, pg) \
only in patch2:
unchanged:
--- db-4.7.25.orig/test/env012.tcl
+++ db-4.7.25/test/env012.tcl
@@ -56,7 +56,7 @@
$testdir $testfile PUT $key $data RECOVER 10 &]
# Wait a while so process 1 has a chance to get going.
- tclsleep 2
+ tclsleep 4
puts "\t\tEnv$tnum.b2: Start process 2."
set p2 [exec $tclsh_path $test_path/wrap.tcl envscript.tcl \
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.alioth.debian.org/pipermail/pkg-db-devel/attachments/20080909/9bd14916/attachment.pgp
More information about the Pkg-db-devel
mailing list