From: Nicholas Clark Date: Sun, 1 May 2011 19:56:48 +0000 (+0100) Subject: Fix typo error in bit-vector tracking mechanism, causing bogus "seen before"s. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FDevel-Size.git;a=commitdiff_plain;h=f404ed4821fb2d22f6c79a027536e12a4053d81b Fix typo error in bit-vector tracking mechanism, causing bogus "seen before"s. On 64 bit platforms which allocate on 8 byte alignment (rather than 16), a low pointer bit could get lost, resulting in new pointers being considered already "seen". Joy, hilarity, failing tests and different results running under gdb. "Found" by BinGOs' smoker, fixed on spectre.mongueurs.net. The help was appreciated. --- diff --git a/CHANGES b/CHANGES index eea2bdc..c52e253 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,11 @@ Revision history for Perl extension Devel::Size. +0.74_53 2011-05-01 nicholas + * Fix typo error in bit-vector tracking mechanism. On 64 bit platforms which + allocate on 8 byte alignment (rather than 16), a low pointer bit could get + lost, resulting in new pointers being considered already "seen". + "Found" by BinGOs' smoker, fixed on spectre.mongueurs.net. Thanks. + 0.74_52 2011-04-23 nicholas * Fix potential SEGVs for OP_AELEMFAST on a lexical (eg $foo[3]) * Fix likely SEGVs for PVOPs (missing break) diff --git a/Size.xs b/Size.xs index 9a54522..c276e44 100644 --- a/Size.xs +++ b/Size.xs @@ -78,7 +78,7 @@ check_new(struct state *st, const void *const p) { (and hence hot in the cache) but we can still deal with any unaligned pointers. */ const size_t cooked_p - = (raw_p >> ALIGN_BITS) | (raw_p << (bits - BYTE_BITS)); + = (raw_p >> ALIGN_BITS) | (raw_p << (bits - ALIGN_BITS)); const U8 this_bit = 1 << (cooked_p & 0x7); U8 **leaf_p; U8 *leaf;