Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use jcmd to create dump files on Windows #103

Closed
lumpfish opened this issue Feb 9, 2021 · 3 comments
Closed

Use jcmd to create dump files on Windows #103

lumpfish opened this issue Feb 9, 2021 · 3 comments
Assignees
Labels
Milestone

Comments

@lumpfish
Copy link
Contributor

lumpfish commented Feb 9, 2021

Request from eclipse-openj9/openj9#11904:

is it possible to first attempt using jcmd to get javacore files and system dump files? The cores acquired via procdump.exe aren't in a good state.

First step is to identify the jcmd commands which result in the creation of these files from https://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/tooldescr006.html

@lumpfish
Copy link
Contributor Author

lumpfish commented Feb 9, 2021

The jcmd commands required are

jcmd <pid> Dump.java
jcmd <pid> Dump.system

@karianna karianna added the bug label Feb 10, 2021
@karianna karianna modified the milestone: February 2021 Feb 10, 2021
@lumpfish lumpfish self-assigned this Feb 17, 2021
@lumpfish
Copy link
Contributor Author

lumpfish commented Feb 18, 2021

PR #105 does the following:

  1. Creates a getJavaProperties method to return the properties listed by java -XshowSettings:properties as a hash array
  2. Creates a java_properties_check.pl script which can be used to test the getJavaProperties method from the command line.
  3. Uses the getJavaProperties method to determine whether java.vm.name contains J9. If it does, and there is a jcmd.exe executable in the jdk bin directory, jcmd is called to take the dumps rather than procdump.exe.

Output from a test run of the PR running the stf SampleOverrunTest:

15:53:16  STF 15:53:20.973 - 
15:53:16  STF 15:53:20.973 - ====================   E X E C U T E -   ====================
15:53:16  STF 15:53:20.973 - Running execute: perl C:/Users/jenkins/workspace/Grinder@2/openjdk-tests/\TKG\output_16136635918689\system_custom_0/20210218-155315-SampleOverrunProcess/execute.pl
15:53:16  STF 15:53:21.337 - 
15:53:16  STF 15:53:21.337 - Java version
15:53:16  STF 15:53:21.338 - Running: C:/Users/jenkins/workspace/Grinder@2/openjdkbinary/j2sdk-image/bin/java -version
15:53:16  Possible unintended interpolation of @2 in string at C:/Users/jenkins/workspace/Grinder@2/openjdk-tests/\TKG\output_16136635918689\system_custom_0/20210218-155315-SampleOverrunProcess/execute.pl line 26.
15:53:17  openjdk version "1.8.0_292-internal"
15:53:17  OpenJDK Runtime Environment (build 1.8.0_292-internal-202102151834-b02)
15:53:17  Eclipse OpenJ9 VM (build master-14abebc65, JRE 1.8.0 Windows Server 2012 R2 amd64-64-Bit Compressed References 20210215_995 (JIT enabled, AOT enabled)
15:53:17  OpenJ9   - 14abebc65
15:53:17  OMR      - a7e83c733
15:53:17  JCL      - 182457fe based on jdk8u292-b02)

15:53:17  STF 15:53:21.978 - 
15:53:17  STF 15:53:21.978 - +------ Step 1 - Run client
15:53:17  STF 15:53:21.978 - | Run foreground process
15:53:17  STF 15:53:21.978 - |   Program:     C:/Users/jenkins/workspace/Grinder@2/openjdkbinary/j2sdk-image/bin/java
15:53:17  STF 15:53:21.978 - |   Mnemonic:    CL
15:53:17  STF 15:53:21.978 - |   Echo:        ECHO_ON
15:53:17  STF 15:53:21.978 - |   Expectation: NON_ZERO_EXIT [0] within 10s
15:53:17  STF 15:53:21.978 - |
15:53:17  STF 15:53:21.979 - Running command: C:/Users/jenkins/workspace/Grinder@2/openjdkbinary/j2sdk-image/bin/java -classpath C:\Users\jenkins\workspace\Grinder@2\jvmtest\system\stf\stf.samples\bin net.adoptopenjdk.stf.processManagement.apps.MiniClient 0 180000
15:53:17  STF 15:53:21.979 - Redirecting stderr to C:/Users/jenkins/workspace/Grinder@2/openjdk-tests/TKG/output_16136635918689/system_custom_0/20210218-155315-SampleOverrunProcess/results/1.CL.stderr
15:53:17  STF 15:53:21.979 - Redirecting stdout to C:/Users/jenkins/workspace/Grinder@2/openjdk-tests/TKG/output_16136635918689/system_custom_0/20210218-155315-SampleOverrunProcess/results/1.CL.stdout
15:53:17  STF 15:53:22.052 - Monitoring processes: CL 
15:53:17  CL  15:53:22.495 Client started
15:53:17  CL  15:53:22.497 Client sleeping for 180000 milliseconds

15:53:28  STF 15:53:33.059 - **FAILED** Process CL  has timed out
15:53:28  STF 15:53:33.059 - Collecting dumps for: CL 
15:53:28  STF 15:53:33.063 - Running command: C:/Users/jenkins/workspace/Grinder@2/openjdkbinary/j2sdk-image/bin/java -XshowSettings:properties -version
15:53:28  STF 15:53:33.063 - Redirecting stderr to C:\Users\jenkins\AppData\Local\Temp\sJSoub0yfP\java_properties.stderr
15:53:28  STF 15:53:33.063 - Redirecting stdout to C:\Users\jenkins\AppData\Local\Temp\sJSoub0yfP\java_properties.stdout
15:53:28  STF 15:53:33.067 - Monitoring processes: stf::stfUtility->getJavaProperties

15:53:29  STF 15:53:33.331 - Monitoring Report Summary:
15:53:29  STF 15:53:33.331 -   o Process stf::stfUtility->getJavaProperties ended sucessfully
15:53:29  STF 15:53:33.335 - Using jcmd.exe to generate .DMP files
15:53:29  STF 15:53:33.336 - Running command: C:\Program Files\AdoptOpenJDK\jdk-8.0.265.01-hotspot\bin\jcmd.exe 23096 Dump.java
15:53:29  STF 15:53:33.336 - Redirecting stderr to C:/Users/jenkins/workspace/Grinder@2/openjdk-tests/TKG/output_16136635918689/system_custom_0/20210218-155315-SampleOverrunProcess/results/1.CL.jvmdump.stderr
15:53:29  STF 15:53:33.336 - Redirecting stdout to C:/Users/jenkins/workspace/Grinder@2/openjdk-tests/TKG/output_16136635918689/system_custom_0/20210218-155315-SampleOverrunProcess/results/1.CL.jvmdump.stdout
15:53:29  STF 15:53:33.341 - Running command: C:\Program Files\AdoptOpenJDK\jdk-8.0.265.01-hotspot\bin\jcmd.exe 23096 Dump.system
15:53:29  STF 15:53:33.341 - Redirecting stderr to C:/Users/jenkins/workspace/Grinder@2/openjdk-tests/TKG/output_16136635918689/system_custom_0/20210218-155315-SampleOverrunProcess/results/1.CL.jvmdump.stderr
15:53:29  STF 15:53:33.341 - Redirecting stdout to C:/Users/jenkins/workspace/Grinder@2/openjdk-tests/TKG/output_16136635918689/system_custom_0/20210218-155315-SampleOverrunProcess/results/1.CL.jvmdump.stdout
15:53:29  STF 15:53:33.345 - Pausing for 30 seconds

15:54:01  STF 15:54:03.345 - Process CL  (pid 23096) is no longer running. Abandoning dump collection.
15:54:01  CL  stderr JVMDUMP039I Processing dump event "abort", detail "" at 2021/02/18 15:53:33 - please wait.
15:54:01  CL  stderr JVMDUMP032I JVM requested System dump using 'C:\Users\jenkins\workspace\Grinder@2\openjdk-tests\TKG\output_16136635918689\system_custom_0\20210218-155315-SampleOverrunProcess\results\core.20210218.155333.23096.0001.dmp' in response to an event
15:54:01  STF 15:54:03.345 - Monitoring Report Summary:
15:54:01  STF 15:54:03.345 -   o Process CL  has timed out
15:54:01  STF 15:54:03.345 - Killing processes: CL 
15:54:01  STF 15:54:03.345 -   o Process CL  pid 23096 is not running
15:54:01  **FAILED** at step 1 (Run client). Expected return value=0 Actual=1 at C:/Users/jenkins/workspace/Grinder@2/openjdk-tests/\TKG\output_16136635918689\system_custom_0/20210218-155315-SampleOverrunProcess/execute.pl line 80.
15:54:01  STF 15:54:03.774 - **FAILED** execute script failed. Expected return value=0 Actual=1
15:54:01  STF 15:54:03.774 - 
15:54:01  STF 15:54:03.774 - ====================   T E A R D O W N   ====================
15:54:01  STF 15:54:03.774 - Running teardown: perl C:/Users/jenkins/workspace/Grinder@2/openjdk-tests/\TKG\output_16136635918689\system_custom_0/20210218-155315-SampleOverrunProcess/tearDown.pl
15:54:01  Possible unintended interpolation of @2 in string at C:/Users/jenkins/workspace/Grinder@2/openjdk-tests/\TKG\output_16136635918689\system_custom_0/20210218-155315-SampleOverrunProcess/tearDown.pl line 26.
15:54:01  STF 15:54:04.145 - TEARDOWN stage completed
15:54:01  STF 15:54:04.168 - 
15:54:01  STF 15:54:04.168 - =====================   R E S U L T S   =====================
15:54:01  STF 15:54:04.168 - Stage results:
15:54:01  STF 15:54:04.168 -   setUp:     pass
15:54:01  STF 15:54:04.168 -   execute:  *fail*
15:54:01  STF 15:54:04.168 -   teardown:  pass
15:54:01  STF 15:54:04.168 - 
15:54:01  STF 15:54:04.168 - Overall result: **FAILED**

Full job link: https://ci.adoptopenjdk.net/view/Test_grinder/job/Grinder/7098/console

@lumpfish
Copy link
Contributor Author

Fixed by #105

@karianna karianna added this to the February 2021 milestone Feb 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants