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

sun/tools/jhsdb/HeapDumpTestWithActiveProcess.java fails with 'JShellToolProvider' missing from stdout/stderr

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • 15
    • 15
    • hotspot
    • None
    • b20

    Description

      After fixing JDK-8230731 and JDK-8242787, and HeapDumpTestWithActiveProcess.java is removed from the problem list, it sometimes fails with:

      java.lang.RuntimeException: Test ERROR java.lang.RuntimeException: 'JShellToolProvider' missing from stdout/stderr
      at JShellHeapDumpTest.printStackTraces(JShellHeapDumpTest.java:105)
      at JShellHeapDumpTest.testHeapDump(JShellHeapDumpTest.java:122)
      at JShellHeapDumpTest.main(JShellHeapDumpTest.java:164)
      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:564)
      at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
      at java.base/java.lang.Thread.run(Thread.java:832)
      Caused by: java.lang.RuntimeException: 'JShellToolProvider' missing from stdout/stderr
      at JShellHeapDumpTest.printStackTraces(JShellHeapDumpTest.java:102)
      ... 8 more

      The reason is because the test is not waiting for the main thread of the spawned jshell process to start up. Thus when the test requests a stack dump, it does not find the JShellToolProvider.

      HeapDumpTestWithActiveProcess just uses JShellHeapDumpTest, but passes the "nosleep" argument so JShellHeapDumpTest does not sleep for two seconds upon launch to avoid a myriad of other potential test failures that result when trying to capture the stack dump of an active thread. However, by not delaying it means that sometims the test requests a thread dump before the jshell process has even started or entered them main thread, thus the expected symbol is missing.

      The fix is to not require the presence of JShellHeapDumpTest when "nosleep" is specified.

      Attachments

        Issue Links

          Activity

            People

              cjplummer Chris Plummer
              cjplummer Chris Plummer
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: