8062870: src/share/vm/services/mallocTracker.hpp:64 assert(_count > 0) failed: Negative counter
authorcoleenp
Tue, 11 Nov 2014 09:59:50 -0500
changeset 27615 d7caba003432
parent 27614 c48433d6a6b0
child 27617 9fe6503f11e8
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
hotspot/src/share/vm/services/mallocTracker.hpp
hotspot/test/runtime/NMT/MallocSiteHashOverflow.java
hotspot/test/runtime/NMT/MallocTrackingVerify.java
--- a/hotspot/src/share/vm/services/mallocTracker.hpp	Tue Nov 11 04:34:56 2014 -0800
+++ b/hotspot/src/share/vm/services/mallocTracker.hpp	Tue Nov 11 09:59:50 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:
--- a/hotspot/test/runtime/NMT/MallocSiteHashOverflow.java	Tue Nov 11 04:34:56 2014 -0800
+++ b/hotspot/test/runtime/NMT/MallocSiteHashOverflow.java	Tue Nov 11 09:59:50 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
--- a/hotspot/test/runtime/NMT/MallocTrackingVerify.java	Tue Nov 11 04:34:56 2014 -0800
+++ b/hotspot/test/runtime/NMT/MallocTrackingVerify.java	Tue Nov 11 09:59:50 2014 -0500
@@ -27,7 +27,6 @@
  * @summary Test to verify correctness of malloc tracking
  * @key nmt jcmd
  * @library /testlibrary /testlibrary/whitebox
- * @ignore 8058251
  * @build MallocTrackingVerify
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail MallocTrackingVerify