You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by up...@apache.org on 2015/10/09 02:37:28 UTC

[10/50] [abbrv] incubator-geode git commit: GEODE-365: HotSpot SIGSEGV attempting to compile javax.print.attribute.EnumSyntax::readResolve with JDK 1.8.0_45 Incorporated changes from GemFire

GEODE-365: HotSpot SIGSEGV attempting to compile javax.print.attribute.EnumSyntax::readResolve with JDK 1.8.0_45
Incorporated changes from GemFire


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/8639b864
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/8639b864
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/8639b864

Branch: refs/heads/feature/GEODE-11
Commit: 8639b864b2d04829abdc8b6f3e18273faecdcdfa
Parents: 3d648db
Author: Barry Oglesby <bo...@pivotal.io>
Authored: Wed Sep 23 14:13:18 2015 -0700
Committer: Barry Oglesby <bo...@pivotal.io>
Committed: Wed Sep 23 14:13:18 2015 -0700

----------------------------------------------------------------------
 .../gemstone/gemfire/cache/EvictionAction.java  |  3 +-
 .../gemfire/cache/EvictionAlgorithm.java        |  3 +-
 .../gemfire/cache/Bug52289JUnitTest.java        | 81 ++++++++++++++++++++
 3 files changed, 85 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8639b864/gemfire-core/src/main/java/com/gemstone/gemfire/cache/EvictionAction.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/cache/EvictionAction.java b/gemfire-core/src/main/java/com/gemstone/gemfire/cache/EvictionAction.java
index c4bb350..ada568f 100644
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/cache/EvictionAction.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/cache/EvictionAction.java
@@ -49,7 +49,8 @@ public final class EvictionAction extends EnumSyntax
     return stringTable;
   }
     
-  private static final EvictionAction[] enumValueTable = {
+  //TODO post Java 1.8.0u45 uncomment final flag, see JDK-8076152
+  private static /*final*/ EvictionAction[] enumValueTable = {
     NONE,
     LOCAL_DESTROY,
     OVERFLOW_TO_DISK

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8639b864/gemfire-core/src/main/java/com/gemstone/gemfire/cache/EvictionAlgorithm.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/cache/EvictionAlgorithm.java b/gemfire-core/src/main/java/com/gemstone/gemfire/cache/EvictionAlgorithm.java
index 33cca0e..248bd17 100644
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/cache/EvictionAlgorithm.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/cache/EvictionAlgorithm.java
@@ -72,7 +72,8 @@ public final class EvictionAlgorithm extends EnumSyntax
     return stringTable;
   }
     
-  private static final EvictionAlgorithm[] enumValueTable = {
+  //TODO post Java 1.8.0u45 uncomment final flag, see JDK-8076152
+  private static /*final*/ EvictionAlgorithm[] enumValueTable = {
     NONE,
     LRU_ENTRY,
     LRU_HEAP,

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8639b864/gemfire-core/src/test/java/com/gemstone/gemfire/cache/Bug52289JUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache/Bug52289JUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/cache/Bug52289JUnitTest.java
new file mode 100644
index 0000000..9efdb02
--- /dev/null
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache/Bug52289JUnitTest.java
@@ -0,0 +1,81 @@
+/*=========================================================================
+ * Copyright (c) 2002-2015 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+
+package com.gemstone.gemfire.cache;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.test.junit.categories.UnitTest;
+
+/**
+ * Test case for Trac <a
+ * href="https://svn.gemstone.com/trac/gemfire/ticket/52289">#52289</a>.
+ * 
+ * Asserts fixes for bug JDK-8076152 in JDK 1.8.0u20 to 1.8.0.u45.
+ * http://bugs.java.com/bugdatabase/view_bug.do?bug_id=8076152
+ * 
+ * The JVM crashes when hotspot compiling a method that uses an array consisting
+ * of objects of a base class when different child classes is used as actual
+ * instance objects AND when the array is constant (declared final). The crash
+ * occurs during process of the aaload byte code.
+ * 
+ * This test and its corrections can be removed after the release of JDK
+ * 1.8.0u60 if we choose to not support 1.8.0u20 - 1.8.0u45 inclusive.
+ * 
+ * @author jbarrett@pivotal.io
+ *
+ * @since 8.2
+ * 
+ */
+@Category(UnitTest.class)
+public class Bug52289JUnitTest {
+
+  @Test
+  public void test() throws IOException, ClassNotFoundException {
+    // Iterate enough to cause JIT to compile
+    // javax.print.attribute.EnumSyntax::readResolve
+    for (int i = 0; i < 100_000; i++) {
+      // Must execute two or more subclasses with final static arrays of
+      // different types.
+      doEvictionAlgorithm();
+      doEvictionAction();
+    }
+  }
+
+  protected void doEvictionAlgorithm() throws IOException, ClassNotFoundException {
+    final ByteArrayOutputStream baos = new ByteArrayOutputStream();
+    final ObjectOutputStream oos = new ObjectOutputStream(baos);
+    oos.writeObject(EvictionAlgorithm.NONE);
+    oos.close();
+
+    final ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
+    final ObjectInputStream ois = new ObjectInputStream(bais);
+    ois.readObject();
+    ois.close();
+  }
+
+  protected void doEvictionAction() throws IOException, ClassNotFoundException {
+    final ByteArrayOutputStream baos = new ByteArrayOutputStream();
+    final ObjectOutputStream oos = new ObjectOutputStream(baos);
+    oos.writeObject(EvictionAction.NONE);
+    oos.close();
+
+    final ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
+    final ObjectInputStream ois = new ObjectInputStream(bais);
+    ois.readObject();
+    ois.close();
+  }
+
+}
\ No newline at end of file