changeset 14172:32891bcd7493

8154212: launcher SEGV when _JAVA_LAUNCHER_DEBUG is set Reviewed-by: alanb, martin
author ksrini
date Thu, 14 Apr 2016 14:23:59 -0700
parents 8f68e0ffbba3
children 9d0e97030468 4b78af87def9
files src/java.base/share/native/libjli/java.h test/tools/launcher/MiscTests.java
diffstat 2 files changed, 18 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/share/native/libjli/java.h	Thu Apr 14 09:32:37 2016 -0700
+++ b/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/test/tools/launcher/MiscTests.java	Thu Apr 14 09:32:37 2016 -0700
+++ b/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");
+        }
     }
 }
-}