-
Bug
-
Resolution: Fixed
-
P5
-
8
-
b36
-
generic
-
generic
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2223276 | 7u6 | David Buck | P5 | Closed | Fixed | b08 |
This is a "forward port" of the fix for Bug 13645891 in JRockit's JRCMD command to Oracle JDK's new jcmd command.
From 13645891
===
I created a jrcmd script and was using something like the below to run it:
jrcmd 12345 -f commands.txt
It turns out that the contents of the commands.txt file must not be more than roughly 256 bytes, otherwise jrcmd will return a cryptic error message (OS dependent, the below is what it looks like on Linux):
jrcmd 11052 -f commands.txt
11052:
java.io.IOException: Premature EOF
at
sun.tools.attach.HotSpotVirtualMachine.readInt(HotSpotVirtualMachine.java:226)
at sun.tools.attach.LinuxVirtualMachine.execute(LinuxVirtualMachine.java:175)
at
sun.tools.attach.HotSpotVirtualMachineAccess.execute(HotSpotVirtualMachineAccess.java:17)
at jrockit.tools.jrcmd.JrCmd.executeCommandForPid(JrCmd.java:115)
at jrockit.tools.jrcmd.JrCmd.main(JrCmd.java:90)
The reason for this is that the attach implementation in JRockit limits the attach operation commands to 256 characters (see attach_internal.h/MAX_ARG_LEN) and jrcmd sends the whole file contents as a single command to the VM. The actual check which bails out the execution can be found in attach.c:attachOperationSetArg called from attach_linux.c:read_request on Linux.
===
From 13645891
===
I created a jrcmd script and was using something like the below to run it:
jrcmd 12345 -f commands.txt
It turns out that the contents of the commands.txt file must not be more than roughly 256 bytes, otherwise jrcmd will return a cryptic error message (OS dependent, the below is what it looks like on Linux):
jrcmd 11052 -f commands.txt
11052:
java.io.IOException: Premature EOF
at
sun.tools.attach.HotSpotVirtualMachine.readInt(HotSpotVirtualMachine.java:226)
at sun.tools.attach.LinuxVirtualMachine.execute(LinuxVirtualMachine.java:175)
at
sun.tools.attach.HotSpotVirtualMachineAccess.execute(HotSpotVirtualMachineAccess.java:17)
at jrockit.tools.jrcmd.JrCmd.executeCommandForPid(JrCmd.java:115)
at jrockit.tools.jrcmd.JrCmd.main(JrCmd.java:90)
The reason for this is that the attach implementation in JRockit limits the attach operation commands to 256 characters (see attach_internal.h/MAX_ARG_LEN) and jrcmd sends the whole file contents as a single command to the VM. The actual check which bails out the execution can be found in attach.c:attachOperationSetArg called from attach_linux.c:read_request on Linux.
===
- backported by
-
JDK-2223276 forward port fix for Bug 13645891 to JDK8 jcmd (1024 byte file size limit issue)
-
- Closed
-
- relates to
-
JDK-7167157 jcmd command file parsing does not respect the "stop" command
-
- Closed
-