RFR: 8307478: Implementation of Prepare to Restrict The Dynamic Loading of Agents [v6]
Alan Bateman
alanb at openjdk.org
Thu Jun 1 05:58:11 UTC 2023
On Wed, 31 May 2023 20:37:23 GMT, Chris Plummer <cjplummer at openjdk.org> 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 since the last revision:
>>
>> - Allow for warning to be skipped when same agent loaded a second/subsequent time
>> - Merge
>> - Tweak javadoc, update test to use more test infra
>> - Merge
>> - Merge
>> - Refresh package description
>> - Merge
>> - Tweak docs
>> - Merge
>> - Draft docs changes
>> - ... and 4 more: https://git.openjdk.org/jdk/compare/5a6c8363...a6d3c23c
>
> 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 `os_lib`, then we return true if any loaded static lib is found. Is this an attempt to limit the warning to just the first static lib that is loaded? Also, why would `null` ever be passed in if there wasn't at least one static lib. Some clarify comments would be useful.
load_agent_from_executable has a comment to explain how statically linked agents are started, that's why it needs to use agent->is_static_lib().&& agent->is_loaded() here. There isn't currently a way to test this but there is other work going to support static builds so it might be possible to write some automated tests at that point.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/13899#discussion_r1212613094
More information about the serviceability-dev
mailing list