JDK-8225388 : Running jcmd Compiler.CodeHeap_Analytics all 0 cause crash.
  • Type: Bug
  • Component: hotspot
  • Sub-Component: svc
  • Affected Version: 11,13
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2019-06-06
  • Updated: 2020-01-16
  • Resolved: 2019-06-07
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 JDK 14
11.0.5Fixed 13 b25Fixed 14Fixed
Description
The Compiler.CodeHeap_Analytics doesn't check the correctness of the granularity parameter.  So not positive integer value leads to a crash.


Comments
Fix Request: fixes a crash. Backport doesn't apply cleanly: see review https://mail.openjdk.java.net/pipermail/jdk-updates-dev/2019-August/001692.html . Tested with tier1 and new test case.
20-08-2019

Confirmed. jcmd <pid> Compile.CodeHeap_Analytics all 0 will crash the target VM. # Problematic frame: # V [libjvm.so+0x966aca] CodeHeapState::aggregate(outputStream*, CodeHeap*, char const*)+0x30a
06-06-2019

The likelihood is low but I managed to crash my stress tests which run for several days.
06-06-2019

The correct fix is be to verify granularity in jcmd and not in aggregate. http://cr.openjdk.java.net/~lmesnik/8225388/webrev.00/
06-06-2019