changeset 40463:8a2083c5e2b1

8163143: illegal bci error with interpreted frames in SA due to mirror being stored in interpreted frames Summary: Added code to represent the frame mirror offset in SA Reviewed-by: dsamersoff Contributed-by: jini.george@oracle.com
author dsamersoff
date Thu, 11 Aug 2016 17:47:47 +0300
parents 67060ef26d11
children 5f0cd3c3f4aa
files jdk/test/sun/tools/jhsdb/BasicLauncherTest.java
diffstat 1 files changed, 33 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/jdk/test/sun/tools/jhsdb/BasicLauncherTest.java	Mon Aug 08 21:59:33 2016 +0900
+++ b/jdk/test/sun/tools/jhsdb/BasicLauncherTest.java	Thu Aug 11 17:47:47 2016 +0300
@@ -107,6 +107,38 @@
         }
     }
 
+    public static void launchJStack() throws IOException {
+
+        if (Platform.isOSX()) {
+            // Coredump stackwalking is not implemented for Darwin
+            System.out.println("This test is not expected to work on OS X. Skipping");
+            return;
+        }
+
+        System.out.println("Starting LingeredApp");
+        try {
+            theApp = LingeredApp.startApp(Arrays.asList("-Xmx256m"));
+
+            System.out.println("Starting jstack against " + theApp.getPid());
+            JDKToolLauncher launcher = createSALauncher();
+
+            launcher.addToolArg("jstack");
+            launcher.addToolArg("--pid=" + Long.toString(theApp.getPid()));
+
+            ProcessBuilder processBuilder = new ProcessBuilder(launcher.getCommand());
+            OutputAnalyzer output = ProcessTools.executeProcess(processBuilder);;
+            output.shouldContain("No deadlocks found");
+            output.shouldNotContain("illegal bci");
+            output.shouldNotContain("AssertionFailure");
+            output.shouldHaveExitValue(0);
+
+        } catch (Exception ex) {
+            throw new RuntimeException("Test ERROR " + ex, ex);
+        } finally {
+            LingeredApp.stopApp(theApp);
+        }
+    }
+
     /**
      *
      * @param vmArgs  - vm and java arguments to launch test app
@@ -151,19 +183,6 @@
                                                        Arrays.asList(toolArgs));
     }
 
-    public static void launchNotOSX(String expectedMessage,
-                              String unexpectedMessage, String... toolArgs)
-        throws IOException {
-
-        if (Platform.isOSX()) {
-            // Coredump stackwalking is not implemented for Darwin
-            System.out.println("This test is not expected to work on OS X. Skipping");
-            return;
-        }
-
-        launch(expectedMessage, unexpectedMessage, toolArgs);
-    }
-
     public static void testHeapDump() throws IOException {
         File dump = new File("jhsdb.jmap.dump." +
                              System.currentTimeMillis() + ".hprof");
@@ -191,7 +210,7 @@
         launchCLHSDB();
 
         launch("compiler detected", null, "jmap", "--clstats");
-        launchNotOSX("No deadlocks found", null, "jstack");
+        launchJStack();
         launch("compiler detected", null, "jmap");
         launch("Java System Properties",
                "System Properties info not available", "jinfo");