Uploaded image for project: 'Code Tools'
  1. Code Tools
  2. CODETOOLS-7903483

jtreg swallows java -version crashing

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • jtreg6.0
    • None
    • tools
    • None

      When testing a jdk build so broken that "java -version" crashes, jtreg only reports:

      Error: cannot determine version for JDK: <path-to-jdk>

      In particular, whatever error output was printed by java -version is completely swallowed and never reported, and it's not clear from logs that java -version even crashed. This happens because of
      https://github.com/openjdk/jtreg/blob/master/src/share/classes/com/sun/javatest/regtest/tool/Tool.java#L1374-L1376

      JDK_Version v = jdk.getJDKVersion(new SearchPath(jtreg_jar, javatest_jar));
              if (v == null)
                  throw new Fault(i18n, "main.jdk.unknown.version", jdk);

      Instead, jtreg should recognize that calling java crashed and report this explicitly, along with any output of the java process.

            lujaniuk Ludvig Janiuk
            lujaniuk Ludvig Janiuk
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: