8151368: SA: Unexpected ArithmeticException in CompactHashTable
authordsamersoff
Mon, 14 Mar 2016 11:45:15 +0300
changeset 37086 e152767075ce
parent 37083 8776e46aa542
child 37087 0b4b27f1b0b2
8151368: SA: Unexpected ArithmeticException in CompactHashTable Summary: Add missed null check Reviewed-by: iklam, dsamersoff Contributed-by: kubota.yuji@gmail.com
hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/CompactHashTable.java
--- a/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/CompactHashTable.java	Sun Mar 13 19:41:11 2016 +0000
+++ b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/CompactHashTable.java	Mon Mar 14 11:45:15 2016 +0300
@@ -81,6 +81,12 @@
   }
 
   public Symbol probe(byte[] name, long hash) {
+
+    if (bucketCount() == 0) {
+      // The table is invalid, so don't try to lookup
+      return null;
+    }
+
     long    symOffset;
     Symbol  sym;
     Address baseAddress = baseAddressField.getValue(addr);