Re: RFR: 8307478: Implementation of Prepare to Restrict The Dynamic Loading of Agents [v9]

2023-06-01 Thread Chris Plummer
On Thu, 1 Jun 2023 16:56:17 GMT, Alan Bateman wrote: >> This is the implementation for JEP 451. There are two parts to this: >> >> 1. A multi-line warning is printed when a JVM TI or Java agent is loaded >> into a running VM. For JVM TI, the message is printed to stderr from >> JvmtiAgent::loa

Re: RFR: 8307478: Implementation of Prepare to Restrict The Dynamic Loading of Agents [v9]

2023-06-01 Thread Alan Bateman
> This is the implementation for JEP 451. There are two parts to this: > > 1. A multi-line warning is printed when a JVM TI or Java agent is loaded into > a running VM. For JVM TI, the message is printed to stderr from > JvmtiAgent::load. For Java agents, it is printed to System.err (as that may

Re: RFR: 8307478: Implementation of Prepare to Restrict The Dynamic Loading of Agents [v8]

2023-06-01 Thread Chris Plummer
On Thu, 1 Jun 2023 12:37:20 GMT, Alan Bateman wrote: >> This is the implementation for JEP 451. There are two parts to this: >> >> 1. A multi-line warning is printed when a JVM TI or Java agent is loaded >> into a running VM. For JVM TI, the message is printed to stderr from >> JvmtiAgent::loa

Re: RFR: 8307478: Implementation of Prepare to Restrict The Dynamic Loading of Agents [v7]

2023-06-01 Thread Chris Plummer
On Thu, 1 Jun 2023 06:46:41 GMT, Serguei Spitsyn wrote: >>> The use of `!JvmtiAgentList::is_loaded(library)` here is a bit confusing. >>> Isn't the library always already loaded by the time we get here (the assert >>> below seems to imply that)? >> >> JvmtiAgentList::load_agent creates the Jv

Re: RFR: 8307478: Implementation of Prepare to Restrict The Dynamic Loading of Agents [v8]

2023-06-01 Thread Serguei Spitsyn
On Thu, 1 Jun 2023 12:37:20 GMT, Alan Bateman wrote: >> This is the implementation for JEP 451. There are two parts to this: >> >> 1. A multi-line warning is printed when a JVM TI or Java agent is loaded >> into a running VM. For JVM TI, the message is printed to stderr from >> JvmtiAgent::loa

Re: RFR: 8307478: Implementation of Prepare to Restrict The Dynamic Loading of Agents [v6]

2023-06-01 Thread Alan Bateman
On Thu, 1 Jun 2023 05:55:43 GMT, Alan Bateman wrote: >> src/hotspot/share/prims/jvmtiAgentList.cpp line 231: >> >>> 229:if (agent->is_static_lib() && agent->is_loaded()) { >>> 230: return true; >>> 231:} >> >> This doesn't make sense to me. If you pass in `null` for `o

Re: RFR: 8307478: Implementation of Prepare to Restrict The Dynamic Loading of Agents [v8]

2023-06-01 Thread Alan Bateman
> This is the implementation for JEP 451. There are two parts to this: > > 1. A multi-line warning is printed when a JVM TI or Java agent is loaded into > a running VM. For JVM TI, the message is printed to stderr from > JvmtiAgent::load. For Java agents, it is printed to System.err (as that may

Re: RFR: 8307478: Implementation of Prepare to Restrict The Dynamic Loading of Agents [v7]

2023-06-01 Thread Serguei Spitsyn
On Wed, 31 May 2023 15:01:37 GMT, Alan Bateman wrote: >> This is the implementation for JEP 451. There are two parts to this: >> >> 1. A multi-line warning is printed when a JVM TI or Java agent is loaded >> into a running VM. For JVM TI, the message is printed to stderr from >> JvmtiAgent::lo

Re: RFR: 8307478: Implementation of Prepare to Restrict The Dynamic Loading of Agents [v7]

2023-05-31 Thread Serguei Spitsyn
On Thu, 1 Jun 2023 05:51:51 GMT, Alan Bateman wrote: >> It looks like you are right. >> There is also and assert at line 519: >> `519 assert(agent->is_loaded(), "invariant");` >> >> So, the agent has to be loaded if we got to the line 512. >> Also, there is a statement at line 507 (before line

Re: RFR: 8307478: Implementation of Prepare to Restrict The Dynamic Loading of Agents [v4]

2023-05-31 Thread Alan Bateman
On Wed, 31 May 2023 22:13:08 GMT, Chris Plummer wrote: >> We can't currently test `jcmd JVMTI.agent_load` with >> `-XX:-EnableDynamicAgentLoading` due to JDK-8304438. But this test is for >> warnings, not that dynamic loading is disallowed. > > @AlanBateman @sspitsyn Can this be revisited now

Re: RFR: 8307478: Implementation of Prepare to Restrict The Dynamic Loading of Agents [v6]

2023-05-31 Thread Alan Bateman
On Wed, 31 May 2023 20:37:23 GMT, Chris Plummer wrote: >> Alan Bateman has updated the pull request with a new target base due to a >> merge or a rebase. The incremental webrev excludes the unrelated changes >> brought in by the merge/rebase. The pull request contains 14 additional >> commits

Re: RFR: 8307478: Implementation of Prepare to Restrict The Dynamic Loading of Agents [v7]

2023-05-31 Thread Alan Bateman
On Thu, 1 Jun 2023 05:20:31 GMT, Serguei Spitsyn wrote: >> src/hotspot/share/prims/jvmtiAgent.cpp line 512: >> >>> 510: >>> 511: // Print warning if EnableDynamicAgentLoading not enabled on the >>> command line >>> 512: if (!FLAG_IS_CMDLINE(EnableDynamicAgentLoading) && >>> !agent->is_ins

Re: RFR: 8307478: Implementation of Prepare to Restrict The Dynamic Loading of Agents [v7]

2023-05-31 Thread Serguei Spitsyn
On Wed, 31 May 2023 20:21:15 GMT, Chris Plummer wrote: >> Alan Bateman has updated the pull request with a new target base due to a >> merge or a rebase. The incremental webrev excludes the unrelated changes >> brought in by the merge/rebase. The pull request contains 17 additional >> commits

Re: RFR: 8307478: Implementation of Prepare to Restrict The Dynamic Loading of Agents [v7]

2023-05-31 Thread Serguei Spitsyn
On Wed, 31 May 2023 20:04:04 GMT, Chris Plummer wrote: >> Alan Bateman has updated the pull request with a new target base due to a >> merge or a rebase. The incremental webrev excludes the unrelated changes >> brought in by the merge/rebase. The pull request contains 17 additional >> commits

Re: RFR: 8307478: Implementation of Prepare to Restrict The Dynamic Loading of Agents [v4]

2023-05-31 Thread Chris Plummer
On Tue, 23 May 2023 14:08:11 GMT, Alan Bateman wrote: >> test/jdk/com/sun/tools/attach/warnings/DynamicLoadWarningTest.java line 108: >> >>> 106: // no warning should be printed >>> 107: test((pid, vm) -> vm.loadAgentLibrary(JVMTI_AGENT_LIB), >>> "-XX:+EnableDynamicAgentLoading"

Re: RFR: 8307478: Implementation of Prepare to Restrict The Dynamic Loading of Agents [v6]

2023-05-31 Thread Chris Plummer
On Mon, 29 May 2023 09:37:08 GMT, Alan Bateman wrote: >> This is the implementation for JEP 451. There are two parts to this: >> >> 1. A multi-line warning is printed when a JVM TI or Java agent is loaded >> into a running VM. For JVM TI, the message is printed to stderr from >> JvmtiAgent::lo

Re: RFR: 8307478: Implementation of Prepare to Restrict The Dynamic Loading of Agents [v7]

2023-05-31 Thread Chris Plummer
On Wed, 31 May 2023 15:01:37 GMT, Alan Bateman wrote: >> This is the implementation for JEP 451. There are two parts to this: >> >> 1. A multi-line warning is printed when a JVM TI or Java agent is loaded >> into a running VM. For JVM TI, the message is printed to stderr from >> JvmtiAgent::lo

Re: RFR: 8307478: Implementation of Prepare to Restrict The Dynamic Loading of Agents [v7]

2023-05-31 Thread Alan Bateman
> This is the implementation for JEP 451. There are two parts to this: > > 1. A multi-line warning is printed when a JVM TI or Java agent is loaded into > a running VM. For JVM TI, the message is printed to stderr from > JvmtiAgent::load. For Java agents, it is printed to System.err (as that may

Re: RFR: 8307478: Implementation of Prepare to Restrict The Dynamic Loading of Agents [v5]

2023-05-31 Thread Kirk Pepperdine
Hi Ron, Thank you for the response. I’d read the JEP you’ve linked also. From what I’ve been able to discern, this change will affect a small majority of our customers as it will change how they deploy observability and diagnostics. I’ve spoken to the some of the product owners and they feel th

Re: RFR: 8307478: Implementation of Prepare to Restrict The Dynamic Loading of Agents [v5]

2023-05-31 Thread Ron Pressler
> On 28 May 2023, at 17:25, Kirk Pepperdine wrote: > > > Call me dumb.. but… I would have the say that the most puzzling piece of this > entire JEP/proposal is that I’m failing to make the connect between how an > agent is loaded and how that strengthens integrity. I keep re-reading this >

Re: RFR: 8307478: Implementation of Prepare to Restrict The Dynamic Loading of Agents [v5]

2023-05-29 Thread Alan Bateman
On Sat, 27 May 2023 08:18:57 GMT, Alan Bateman wrote: > I agree it could be annoying to have multiple warnings if the profiler is > attaching and loading the same agent library many times. I've updated the changes to allow it be implementation specific as to whether a warning is printed when

Re: RFR: 8307478: Implementation of Prepare to Restrict The Dynamic Loading of Agents [v6]

2023-05-29 Thread Alan Bateman
> This is the implementation for JEP 451. There are two parts to this: > > 1. A multi-line warning is printed when a JVM TI or Java agent is loaded into > a running VM. For JVM TI, the message is printed to stderr from > JvmtiAgent::load. For Java agents, it is printed to System.err (as that may

Re: RFR: 8307478: Implementation of Prepare to Restrict The Dynamic Loading of Agents [v5]

2023-05-28 Thread Kirk Pepperdine
Hi Andrei, > On May 26, 2023, at 5:00 PM, Andrei Pangin wrote: > >As @pron mentioned, the presence of `-agentlib/agentpath` option serves as > an explicit user consent to use the tool, and disallowing such agents (or > issuing a warning about them) is a non-goal of the JEP. > >With

Re: RFR: 8307478: Implementation of Prepare to Restrict The Dynamic Loading of Agents [v5]

2023-05-27 Thread Alan Bateman
On Fri, 26 May 2023 23:58:12 GMT, Andrei Pangin wrote: > When testing the proposed patch, I stumbled upon two (related) issues: Thanks for bringing this up. The question is whether dynamically loading the same same agent library N times is treated as one or N agents. Similarly, if an agent lib

Re: RFR: 8307478: Implementation of Prepare to Restrict The Dynamic Loading of Agents [v5]

2023-05-26 Thread Andrei Pangin
On Tue, 23 May 2023 15:32:58 GMT, Alan Bateman wrote: >> This is the implementation for JEP 451. There are two parts to this: >> >> 1. A multi-line warning is printed when a JVM TI or Java agent is loaded >> into a running VM. For JVM TI, the message is printed to stderr from >> JvmtiAgent::lo

Re: RFR: 8307478: Implementation of Prepare to Restrict The Dynamic Loading of Agents [v5]

2023-05-23 Thread Chris Plummer
On Tue, 23 May 2023 15:32:58 GMT, Alan Bateman wrote: >> This is the implementation for JEP 451. There are two parts to this: >> >> 1. A multi-line warning is printed when a JVM TI or Java agent is loaded >> into a running VM. For JVM TI, the message is printed to stderr from >> JvmtiAgent::lo

Re: RFR: 8307478: Implementation of Prepare to Restrict The Dynamic Loading of Agents [v5]

2023-05-23 Thread Alan Bateman
> This is the implementation for JEP 451. There are two parts to this: > > 1. A multi-line warning is printed when a JVM TI or Java agent is loaded into > a running VM. For JVM TI, the message is printed to stderr from > JvmtiAgent::load. For Java agents, it is printed to System.err (as that may

Re: RFR: 8307478: Implementation of Prepare to Restrict The Dynamic Loading of Agents [v4]

2023-05-23 Thread Alan Bateman
On Mon, 22 May 2023 23:25:28 GMT, Chris Plummer wrote: >> Alan Bateman has updated the pull request with a new target base due to a >> merge or a rebase. The incremental webrev excludes the unrelated changes >> brought in by the merge/rebase. The pull request contains 10 additional >> commits

Re: RFR: 8307478: Implementation of Prepare to Restrict The Dynamic Loading of Agents [v4]

2023-05-23 Thread Alan Bateman
On Mon, 22 May 2023 23:06:44 GMT, Serguei Spitsyn wrote: >> Alan Bateman has updated the pull request with a new target base due to a >> merge or a rebase. The incremental webrev excludes the unrelated changes >> brought in by the merge/rebase. The pull request contains 10 additional >> commit

Re: RFR: 8307478: Implementation of Prepare to Restrict The Dynamic Loading of Agents [v4]

2023-05-22 Thread Chris Plummer
On Fri, 19 May 2023 17:11:36 GMT, Alan Bateman wrote: >> This is the implementation for JEP 451. There are two parts to this: >> >> 1. A multi-line warning is printed when a JVM TI or Java agent is loaded >> into a running VM. For JVM TI, the message is printed to stderr from >> JvmtiAgent::lo

Re: RFR: 8307478: Implementation of Prepare to Restrict The Dynamic Loading of Agents [v4]

2023-05-22 Thread Chris Plummer
On Fri, 19 May 2023 17:11:36 GMT, Alan Bateman wrote: >> This is the implementation for JEP 451. There are two parts to this: >> >> 1. A multi-line warning is printed when a JVM TI or Java agent is loaded >> into a running VM. For JVM TI, the message is printed to stderr from >> JvmtiAgent::lo

Re: RFR: 8307478: Implementation of Prepare to Restrict The Dynamic Loading of Agents [v4]

2023-05-22 Thread Serguei Spitsyn
On Fri, 19 May 2023 17:11:36 GMT, Alan Bateman wrote: >> This is the implementation for JEP 451. There are two parts to this: >> >> 1. A multi-line warning is printed when a JVM TI or Java agent is loaded >> into a running VM. For JVM TI, the message is printed to stderr from >> JvmtiAgent::lo

Re: RFR: 8307478: Implementation of Prepare to Restrict The Dynamic Loading of Agents [v4]

2023-05-19 Thread Alan Bateman
> This is the implementation for JEP 451. There are two parts to this: > > 1. A multi-line warning is printed when a JVM TI or Java agent is loaded into > a running VM. For JVM TI, the message is printed to stderr from > JvmtiAgent::load. For Java agents, it is printed to System.err (as that may

Re: RFR: 8307478: Implementation of Prepare to Restrict The Dynamic Loading of Agents [v3]

2023-05-15 Thread Alan Bateman
> This is the implementation for JEP 451. There are two parts to this: > > 1. A multi-line warning is printed when a JVM TI or Java agent is loaded into > a running VM. For JVM TI, the message is printed to stderr from > JvmtiAgent::load. For Java agents, it is printed to System.err (as that may

Re: RFR: 8307478: Implementation of Prepare to Restrict The Dynamic Loading of Agents [v2]

2023-05-14 Thread Alan Bateman
> This is the implementation for JEP 451. There are two parts to this: > > 1. A multi-line warning is printed when a JVM TI or Java agent is loaded into > a running VM. For JVM TI, the message is printed to stderr from > JvmtiAgent::load. For Java agents, it is printed to System.err (as that may

Re: RFR: 8307478: Implementation of Prepare to Restrict The Dynamic Loading of Agents

2023-05-14 Thread Andrey Turbanov
On Wed, 10 May 2023 11:12:49 GMT, Alan Bateman wrote: > This is the implementation for JEP 451. There are two parts to this: > > 1. A multi-line warning is printed when a JVM TI or Java agent is loaded into > a running VM. For JVM TI, the message is printed to stderr from > JvmtiAgent::load. F

Re: RFR: 8307478: Implementation of Prepare to Restrict The Dynamic Loading of Agents

2023-05-11 Thread forax
- Original Message - > From: "Alan Bateman" > To: "Remi Forax" > Cc: "hotspot-runtime-dev" , > "serviceability-dev" > Sent: Thursday, May 11, 2023 3:46:59 PM > Subject: Re: RFR: 8307478: Implementation of Prepare to Restrict The

Re: RFR: 8307478: Implementation of Prepare to Restrict The Dynamic Loading of Agents

2023-05-11 Thread Alan Bateman
On 11/05/2023 14:28, Remi Forax wrote: : I believe the flag should mention that what is traced is just the dynamic instrumentation, static instrumentation is not an issue, perhaps "-Djdk.instrument.traceDynamicUsage=true" There is static, load-time, and dynamic instrumentation. The Instrumenta

Re: RFR: 8307478: Implementation of Prepare to Restrict The Dynamic Loading of Agents

2023-05-11 Thread Remi Forax
- Original Message - > From: "Alan Bateman" > To: hotspot-runtime-...@openjdk.org, "serviceability-dev" > > Sent: Thursday, May 11, 2023 3:04:16 PM > Subject: RFR: 8307478: Implementation of Prepare to Restrict The Dynamic > Loading of Agents &g

RFR: 8307478: Implementation of Prepare to Restrict The Dynamic Loading of Agents

2023-05-11 Thread Alan Bateman
This is the implementation for JEP 451. There are two parts to this: 1. A multi-line warning is printed when a JVM TI or Java agent is loaded into a running VM. For JVM TI, the message is printed to stderr from JvmtiAgent::load. For Java agents, it is printed to System.err (as that may be redire