JDK-8221730 : jcmd process name matching broken
  • Type: Bug
  • Component: core-svc
  • Sub-Component: tools
  • Affected Version: 13
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2019-04-01
  • Updated: 2024-12-06
  • Resolved: 2019-04-08
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 13
11.0.27-oracleFixed 13 b16Fixed
Related Reports
Relates :  
Relates :  
Description
jcmd process name matching seems broken in head.

I have a running wildfly instance:

thomas@mainframe:~$ jcmd 
30788 jdk.jcmd/sun.tools.jcmd.JCmd
30266 /shared/projects/wildfly/wildfly-16.0.0.Final/jboss-modules.jar -mp /shared/projects/wildfly/wildfly-16.0.0.Final/modules org.jboss.as.standalone -Djboss.home.dir=/shared/projects/wildfly/wildfly-16.0.0.Final -Djboss.server.base.dir=/shared/projects/wildfly/wildfly-16.0.0.Final/standalone

But I cannot attach to it via name part:

thomas@mainframe:~$ jcmd wildfly VM.version
Could not find any processes matching : 'wildfly'

It used to work. It works with jdk11 jcmd and even older jcmds:

thomas@mainframe:~$ oraclejdk8/bin/jcmd  wildfly VM.version
30266:
OpenJDK 64-Bit Server VM version 11.0.3-ea+5-sapmachine
JDK 11.0.3

thomas@mainframe:~$ oraclejdk11/bin/jcmd  wildfly VM.version
30266:
OpenJDK 64-Bit Server VM version 11.0.3-ea+5-sapmachine
JDK 11.0.3

Note that I still can attach just fine via pid, it is just cumbersome.


Comments
Fix request (11u): This fix should be pushed together with 8205654 which was already approved, as advised by the developers: https://mail.openjdk.java.net/pipermail/jdk-updates-dev/2019-July/001522.html The patch applies cleanly and stabilizes the tests.
05-08-2019

URL: http://hg.openjdk.java.net/jdk/jdk/rev/6733a9176cce User: dtitov Date: 2019-04-08 17:10:48 +0000
08-04-2019

It's related with JDK-8205654. Before these changes ( that applicable for Linux platform only) when the application was started with -jar option the jcmd used to match the main class argument against a full path to the jar file, in this case /shared/projects/wildfly/wildfly-16.0.0.Final/jboss-modules.jar rather than against the main class name org.jboss.modules.Main.
03-04-2019

It seems likely this regression is caused by JDK-8205654. Assigning to Daniil.
02-04-2019