Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8211923

[Testbug] serviceability/sa/ClhsdbFindPC.java ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1

    Details

      Description

      Test failed in tier 1 of the CI:

      Attaching to process 14324, please wait...
      Warning: Nashorn engine is planned to be removed from a future JDK release
      javax.script.ScriptException: TypeError: sapkg.runtime.VM.getVM is not a function in sa.js at line number 54
      javax.script.ScriptException: TypeError: sapkg.runtime.VM.getVM is not a function in sa.js at line number 54
      java.lang.NullPointerException
      at jdk.hotspot.agent/sun.jvm.hotspot.tools.StackTrace.run(StackTrace.java:83)
      at jdk.hotspot.agent/sun.jvm.hotspot.CommandProcessor$24.doit(CommandProcessor.java:1066)
      at jdk.hotspot.agent/sun.jvm.hotspot.CommandProcessor.executeCommand(CommandProcessor.java:1974)
      at jdk.hotspot.agent/sun.jvm.hotspot.CommandProcessor.executeCommand(CommandProcessor.java:1944)
      at jdk.hotspot.agent/sun.jvm.hotspot.CommandProcessor.run(CommandProcessor.java:1824)
      at jdk.hotspot.agent/sun.jvm.hotspot.CLHSDB.run(CLHSDB.java:99)
      at jdk.hotspot.agent/sun.jvm.hotspot.CLHSDB.main(CLHSDB.java:40)
      at jdk.hotspot.agent/sun.jvm.hotspot.SALauncher.runCLHSDB(SALauncher.java:191)
      at jdk.hotspot.agent/sun.jvm.hotspot.SALauncher.main(SALauncher.java:439)
       LingeredApp stdout: [];
       LingeredApp stderr: []
       LingeredApp exitValue = 0
      java.lang.RuntimeException: Test ERROR java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
      at ClhsdbFindPC.testFindPC(ClhsdbFindPC.java:95)
      at ClhsdbFindPC.main(ClhsdbFindPC.java:103)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
      at java.base/java.lang.Thread.run(Thread.java:835)
      Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
      at ClhsdbFindPC.testFindPC(ClhsdbFindPC.java:69)
      ... 7 more

      Something has gone with regards to running the test, but the test logic is not robust enough. We have:

                 // Output could be null if the test was skipped due to
                  // attach permission issues.
                  if (output != null) {
                      String cmdStr = null;
                      String[] parts = output.split("LingeredApp.main");
                      String[] tokens = parts[1].split(" ");

      but if output is not null, but doesn't contain LingeredApp.main then we don't have two parts and so parts[1] throws ArrayIndexOutOfBoundException

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                cjplummer Chris Plummer
                Reporter:
                dholmes David Holmes
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: