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

String pattern used in ClhsdbInspect.java is too liberal

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • None
    • hotspot
    • None

      In Oracle hs-tier4, we have a task that runs test/hotspot/jtreg/serviceability/sa/ClhsdbInspect.java with the following VM parameters:

      -XX:+UnlockDiagnosticVMOptions -XX:ArchiveRelocationMode=1 -Xlog:cds -XX:NativeMemoryTracking=detail

      I have made some local modifications that prints out an log message like this:

      [0.097s][info][cds] patching heap embedded pointers for ca0: 0xf7fe0000 -> 0xfffe0000

      This message is matched by the following pattern:

      https://github.com/openjdk/jdk/blob/09629570f5d064dc2a5cd670de8d648156ac3991/test/hotspot/jtreg/serviceability/sa/ClhsdbInspect.java#L161-L164

                  String examineCmdOutput = test.run(theApp.getPid(), cmds, expStrMap, null);
                  String examineResult = examineCmdOutput.substring(examineCmdOutput.indexOf(": 0x")+2);

      As a result, the test fails with:

      java.lang.RuntimeException: Test ERROR java.lang.RuntimeException: '0xf7fe0000 -> 0xfffe0000: 0x' missing from stdout/stderr
      at ClhsdbInspect.main(ClhsdbInspect.java:194)
      at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
      at java.base/java.lang.reflect.Method.invoke(Method.java:578)
      at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:125)
      at java.base/java.lang.Thread.run(Thread.java:1591)
      Caused by: java.lang.RuntimeException: '0xf7fe0000 -> 0xfffe0000: 0x' missing from stdout/stderr
      at jdk.test.lib.process.OutputAnalyzer.shouldMatch(OutputAnalyzer.java:340)
      at ClhsdbLauncher.runCmd(ClhsdbLauncher.java:166)
      at ClhsdbLauncher.run(ClhsdbLauncher.java:203)
      at ClhsdbInspect.main(ClhsdbInspect.java:171)
      ... 4 more

            cjplummer Chris Plummer
            iklam Ioi Lam
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: