JDK-8219721 : jcmd from earlier release will hang attaching to VM with JDK-8215622 applied
  • Type: Bug
  • Component: core-svc
  • Affected Version: 13
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2019-02-26
  • Updated: 2024-08-02
  • Resolved: 2019-03-12
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 13
13 b12Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Description
https://mail.openjdk.java.net/pipermail/serviceability-dev/2019-February/027240.html


When I attached to VM which is after 8215622 change via jcmd in JDK 8 on Linux, jcmd hanged.
I checked the status of target VM and jcmd, LinuxAttachListener::read_request() on target VM was waiting for
subsequent argument.

JDK-8215622 increased number of arguments of Attach API [1].
Thus AttachListener will be waiting the command from client infinitely.


[1] http://hg.openjdk.java.net/jdk/jdk/rev/e7cf035682e3#l2.1
Comments
URL: http://hg.openjdk.java.net/jdk/jdk/rev/f984aca565c1 User: dholmes Date: 2019-03-12 01:26:36 +0000
12-03-2019

JDK-8215622 increased the maximum number of args from 3 to 4. The attach listener logic should be able to read up to that many args in a request, but it seems that it is trying to read exactly that many args (on Linux at least) and that is wrong. It should be reading the complete "request packet" sent by the client - which means it needs to know when the end of the "packet" has arrived either by some marker or else by reading the expected size up front. It's not clear how the simple socket-based communication can be adjusted to handle this correctly.
26-02-2019