Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement JEP 451: Prepare to Disallow the Dynamic Loading of Agents #17932

Merged
merged 1 commit into from
Aug 12, 2023

Conversation

JasonFengJ9
Copy link
Member

@JasonFengJ9 JasonFengJ9 commented Aug 10, 2023

Implement JEP 451: Prepare to Disallow the Dynamic Loading of Agents

Print warning message when loading an agent via AttachAPI loadAgentLibraryImpl() if -XX:+EnableDynamicAgentLoading is not specified, and the agent wasn't loaded before;
Added isAgentLibraryLoaded() to determine if an agent has been loaded already;
Implemented JVM_PrintWarningAtDynamicAgentLoad();
Added jcmd command JVMTI.agent_load to support openjdk test test/jdk/com/sun/tools/attach/warnings/DynamicLoadWarningTest.java;
Updated a few trace points within loadAgentLibraryGeneric().

This passes an internal grinder openjdk test/jdk/com/sun/tools/attach/warnings/DynamicLoadWarningTest.java w/

related

Signed-off-by: Jason Feng [email protected]

runtime/j9vm/javanextvmi.cpp Outdated Show resolved Hide resolved
runtime/jvmti/j9jvmti.tdf Outdated Show resolved Hide resolved
runtime/jvmti/j9jvmti.tdf Outdated Show resolved Hide resolved
runtime/vm/BytecodeInterpreter.hpp Outdated Show resolved Hide resolved
runtime/vm/BytecodeInterpreter.hpp Outdated Show resolved Hide resolved
@pshipton
Copy link
Member

The line endings check failed.

19:59:46  runtime/j9vm/javanextvmi.cpp:554: trailing whitespace.
19:59:46  +	if (J9_ARE_ANY_BITS_SET(vm->runtimeFlags, J9_RUNTIME_ALLOW_DYNAMIC_AGENT) 

@pshipton
Copy link
Member

pshipton commented Aug 11, 2023

The JEP is for jdk21 but many of the changes to OpenJ9 apply to all versions so I've removed the jdk21 label.

@pshipton
Copy link
Member

pshipton commented Aug 11, 2023

There hasn't been any doc issue created for -XX:+EnableDynamicAgentLoading yet.

@JasonFengJ9
Copy link
Member Author

The JEP is for jdk21 but the changes to OpenJ9 apply to all versions so I've removed the jdk21 label.

Only JDK21 prints the warning message.

runtime/jvmti/j9jvmti.tdf Outdated Show resolved Hide resolved
runtime/jvmti/j9jvmti.tdf Outdated Show resolved Hide resolved
runtime/jvmti/jvmtiStartup.c Show resolved Hide resolved
runtime/vm/BytecodeInterpreter.hpp Show resolved Hide resolved
runtime/vm/BytecodeInterpreter.hpp Outdated Show resolved Hide resolved
runtime/jvmti/jvmtiStartup.c Outdated Show resolved Hide resolved
runtime/vm/BytecodeInterpreter.hpp Outdated Show resolved Hide resolved
Print warning message when loading an agent via AttachAPI
loadAgentLibraryImpl() if -XX:+EnableDynamicAgentLoading is not
specified, and the agent wasn't loaded before;
Added isAgentLibraryLoaded() to determine if an agent has been loaded
already;
Implemented JVM_PrintWarningAtDynamicAgentLoad();
Added jcmd command JVMTI.agent_load;
Updated a few trace points within loadAgentLibraryGeneric().

Signed-off-by: Jason Feng <[email protected]>
@keithc-ca
Copy link
Contributor

Jenkins test sanity aix,zlinux,win jdk17

@JasonFengJ9
Copy link
Member Author

There hasn't been any doc issue created for -XX:+EnableDynamicAgentLoading yet.

Created

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants