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

jcmd JVMTI.agent_load should obey EnableDynamicAgentLoading

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P3 P3
    • 21
    • hotspot
    • None
    • svc
    • behavioral
    • minimal
    • Hide
      This change fixes the incorrect behavior. The compatibility risk is minimal as the EnableDynamicAgentLoading flag is set to true by default. The effect will be observed only when this flag explicitly set to false at VM startup with option -XX:-EnableDynamicAgentLoading. The desired behavior in such cases is to disallow dynamic agent loading.
      Show
      This change fixes the incorrect behavior. The compatibility risk is minimal as the EnableDynamicAgentLoading flag is set to true by default. The effect will be observed only when this flag explicitly set to false at VM startup with option -XX:-EnableDynamicAgentLoading. The desired behavior in such cases is to disallow dynamic agent loading.
    • add/remove/modify command line option
    • Implementation

      Summary

      The jcmd JVMTI.agent_load should obey the EnableDynamicAgentLoading VM flag.

      Problem

      The VM option EnableDynamicAgentLoading was added in JDK 9, default true, to allow deployment to choose whether to allow agents to be loaded/started in the VM. The VM option does the right thing for tools using the Attach API but jcmd JVMTI.agent_load was missed.

      Solution

      This should be fixed to disallow loading JVMTI agents when the EnableDynamicAgentLoading flag is false.

      Specification

      This is pure behavioral change which does not change the specs.

            sspitsyn Serguei Spitsyn
            alanb Alan Bateman
            Alan Bateman
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: