Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8278419

JFR jcmd option contract "This value cannot be changed once JFR has been initialized" is not enforced

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: 18
    • Fix Version/s: 18
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
      jfr
    • Resolved In Build:
      b28
    • Verification:
      Verified

      Backports

        Description

        Several options are exposed via the jcmd JFR.configure command, and their descriptions make it quite clear that "This value cannot be changed once JFR has been initialized".
        IIRC, it used to be the case that these values were prevented from being set after initialization, but somehow the proper enforcements are no longer in place.

        For example:

        The option "stackdepth=" is used to configure the default depth for capturing stacktraces. The option is available on the command-line, like -XX:FlightRecorderOptions:stackdepth=64.

        The option is also exposed via jcmd, via the JFR.configure command, for example:

        jcmd <pid> JFR.configure stackdepth=64

        The contract specified for the option when using jcmd JFR.configure during runtime is as follows:

        Option:
        stackdepth

        Description:
        (Optional) Stack depth for stack traces. Setting this value greater than the default of 64 may cause a performance degradation. This value cannot be changed once JFR has been initialized. (LONG, 64));

        Not enforcing this condition is problematic because the stacktrace buffers are allocated with the value specified on startup, but the stacktrace capture code will use the current depth value.

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                mgronlun Markus Grönlund
                Reporter:
                mgronlun Markus Grönlund
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: