# HG changeset patch # User coleenp # Date 1416004778 18000 # Node ID ec2c6fdd1ce605156611f2363482d7c5d8a4e5d1 # Parent 84e11eeec136061da9a1a1798a4d39637f511c1b 8062870: src/share/vm/services/mallocTracker.hpp:64 assert(_count > 0) failed: Negative counter Summary: Signed bitfield size y can only have (1 << y)-1 values. Reviewed-by: shade, dholmes, jrose, ctornqvi, gtriantafill diff -r 84e11eeec136 -r ec2c6fdd1ce6 src/share/vm/services/mallocTracker.hpp --- a/src/share/vm/services/mallocTracker.hpp Fri Nov 14 07:51:50 2014 -0800 +++ b/src/share/vm/services/mallocTracker.hpp Fri Nov 14 17:39:38 2014 -0500 @@ -243,15 +243,15 @@ size_t _flags : 8; size_t _pos_idx : 16; size_t _bucket_idx: 40; -#define MAX_MALLOCSITE_TABLE_SIZE ((size_t)1 << 40) -#define MAX_BUCKET_LENGTH ((size_t)(1 << 16)) +#define MAX_MALLOCSITE_TABLE_SIZE right_n_bits(40) +#define MAX_BUCKET_LENGTH right_n_bits(16) #else size_t _size : 32; size_t _flags : 8; size_t _pos_idx : 8; size_t _bucket_idx: 16; -#define MAX_MALLOCSITE_TABLE_SIZE ((size_t)(1 << 16)) -#define MAX_BUCKET_LENGTH ((size_t)(1 << 8)) +#define MAX_MALLOCSITE_TABLE_SIZE right_n_bits(16) +#define MAX_BUCKET_LENGTH right_n_bits(8) #endif // _LP64 public: diff -r 84e11eeec136 -r ec2c6fdd1ce6 test/runtime/NMT/MallocSiteHashOverflow.java --- a/test/runtime/NMT/MallocSiteHashOverflow.java Fri Nov 14 07:51:50 2014 -0800 +++ b/test/runtime/NMT/MallocSiteHashOverflow.java Fri Nov 14 17:39:38 2014 -0500 @@ -27,7 +27,6 @@ * @requires sun.arch.data.model == "32" * @key nmt jcmd stress * @library /testlibrary /testlibrary/whitebox - * @ignore 8062870 * @build MallocSiteHashOverflow * @run main ClassFileInstaller sun.hotspot.WhiteBox * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail MallocSiteHashOverflow