8154212: launcher SEGV when _JAVA_LAUNCHER_DEBUG is set
authorksrini
Thu, 14 Apr 2016 14:23:59 -0700
changeset 37359 4a3768da1851
parent 37358 4cf5d88cafdd
child 37360 ca6e631dfa5a
child 37533 3b9eb1a3a4ee
8154212: launcher SEGV when _JAVA_LAUNCHER_DEBUG is set Reviewed-by: alanb, martin
jdk/src/java.base/share/native/libjli/java.h
jdk/test/tools/launcher/MiscTests.java
--- a/jdk/src/java.base/share/native/libjli/java.h	Thu Apr 14 09:32:37 2016 -0700
+++ b/jdk/src/java.base/share/native/libjli/java.h	Thu Apr 14 14:23:59 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -228,7 +228,7 @@
 };
 
 static const char *launchModeNames[]
-    = { "Unknown", "Main class", "JAR file" };
+    = { "Unknown", "Main class", "JAR file", "Module" };
 
 typedef struct {
     int    argc;
--- a/jdk/test/tools/launcher/MiscTests.java	Thu Apr 14 09:32:37 2016 -0700
+++ b/jdk/test/tools/launcher/MiscTests.java	Thu Apr 14 14:23:59 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 6856415
+ * @bug 6856415 8154212
  * @summary Miscellaneous tests, Exceptions
  * @compile -XDignore.symbol.file MiscTests.java
  * @run main MiscTests
@@ -33,7 +33,9 @@
 import java.io.File;
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 public class MiscTests extends TestHelper {
 
@@ -103,11 +105,22 @@
         }
     }
 
+    static void testJLDEnvWithTool() {
+        final Map<String, String> envMap = new HashMap<>();
+        envMap.put("_JAVA_LAUNCHER_DEBUG", "true");
+        TestResult tr = doExec(envMap, javacCmd, "-version");
+        tr.checkPositive();
+        if (!tr.isOK()) {
+           System.out.println(tr);
+        }
+    }
+
     public static void main(String... args) throws IOException {
         testWithClassPathSetViaProperty();
         test6856415();
+        testJLDEnvWithTool();
         if (testExitValue != 0) {
             throw new Error(testExitValue + " tests failed");
+        }
     }
 }
-}