<div dir="ltr"><div>Hi,</div><div><br></div><div>I do share some concerns of the community, however many have voiced it with a better english that I could ever do. But I'd like to mention two things:<br></div><div><br></div><div>1. There is another usage that I think will be visibly impacted : in tests it's often necessary to alter part of the system to stress some parts. In doing so some libraries offer these capabilities, often by relying on an ad hoc agent ; I hope this falls in the useful application of this mechanism. I understand the goal is mostly about applications running in production, yet it's likely the effect will be visible well before code reaches production. <br></div><div><br></div><div>2. I was wondering however about the relation of this JEP with the following property :<br></div><div><br></div><div>```<br></div><div><div style="color:rgb(212,212,212);background-color:rgb(30,30,30);font-family:Menlo,Monaco,"Courier New",monospace;font-weight:normal;font-size:12px;line-height:18px;white-space:pre"><div><span style="color:rgb(212,212,212)">-Djdk.attach.allowAttachSelf=true</span></div></div></div><div>```<br></div><div><br></div><div>This affects the attachment not agent loading, however I believe this JEP should at least mention this property as well as it seems directly tied to one of the mentioned problems about detecting who loads the agent.</div><div><br></div><div>Best regards<br></div><div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div>-- Brice</div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, May 10, 2023 at 1:08 PM Volker Simonis <<a href="mailto:volker.simonis@gmail.com">volker.simonis@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Mon, May 8, 2023 at 9:17 PM Mark Reinhold <<a href="mailto:mark.reinhold@oracle.com" target="_blank">mark.reinhold@oracle.com</a>> wrote:<br>
><br>
> <a href="https://openjdk.org/jeps/451" rel="noreferrer" target="_blank">https://openjdk.org/jeps/451</a><br>
><br>
> Summary: Issue warnings when agents are loaded dynamically into a<br>
> running JVM. These warnings aim to prepare users for a future release<br>
> which disallows the dynamic loading of agents by default in order to<br>
> improve integrity by default. Serviceability tools that load agents at<br>
> startup will not cause warnings to be issued in any release.<br>
><br>
> - Mark<br>
<br>
First of all, thanks for adopting the "warning first" approach before<br>
disabling dynamic agent loading by default. I think that's reasonable<br>
and useful.<br>
<br>
I still wonder why this JEP has scope "SE"? During the discussion<br>
about the draft (which was initially about "disallowing by default")<br>
it was mentioned that once dynamic loading will be disabled by<br>
default, this will be mandated in the platform spec (e.g. in the<br>
package documentation of the java.lang.instrument package [1]). But<br>
now that the JEP was softened to a warning, do you still plan to<br>
mandate the warning in the SE platform spec as well?<br>
<br>
In general, I think the current specification (e.g. in [1]) is good<br>
and gives vendors the freedom to choose the approach which is most<br>
appropriate for their users (e.g. they could already now disable<br>
dynamic agent loading by default):<br>
<br>
"An implementation may provide a mechanism to start agents sometime<br>
after the VM has started. The details as to how this is initiated are<br>
implementation specific".<br>
<br>
Explicitly forbidding dynamic agent loading without a command line<br>
option in the specification seems over-regulative to me.<br>
<br>
Finally, I think it feels a little unfortunate that a JEP candidate<br>
already contains and mentions the JDK release where it will be<br>
implemented. This could create the impression that the JEP has been<br>
targeted long before it was publicly discussed and proposed.<br>
<br>
Thank you and best regards,<br>
Volker<br>
<br>
[1] <a href="https://docs.oracle.com/en/java/javase/20/docs/api/java.instrument/java/lang/instrument/package-summary.html" rel="noreferrer" target="_blank">https://docs.oracle.com/en/java/javase/20/docs/api/java.instrument/java/lang/instrument/package-summary.html</a><br>
</blockquote></div>