JDK-8307478 : Implementation of Prepare to Restrict The Dynamic Loading of Agents
  • Type: Enhancement
  • Component: core-svc
  • Sub-Component: tools
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2023-05-04
  • Updated: 2024-02-09
  • Resolved: 2023-06-02
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 21
21 b26Fixed
Related Reports
CSR :  
Relates :  
Relates :  
Relates :  
Sub Tasks
JDK-8308750 :  
Description
Issue warnings when agents are loaded dynamically into a running JVM. The warnings aim to prepare users for a future release which disallows the dynamic loading of agents by default.
Comments
Hi [~alanb] here is the new issue : https://bugs.openjdk.org/browse/JDK-8309549 .
06-06-2023

[~mbaesken] It might be better to create a new bug rather adding comments here. From the AssertionFailedError and the stack trace then I suspect the issue is that loading the same shared library twice (with dlopen) is given a different address so it's not recognized as the same agent library, hence a second warning is printed when the test expects only one warning.
06-06-2023

The added test com/sun/tools/attach/warnings/DynamicLoadWarningTest.java always fails on AIX with the output : ----------System.err:(294/28579)---------- STARTED DynamicLoadWarningTest::testLoadJavaAgent 'testLoadJavaAgent()' SUCCESSFUL DynamicLoadWarningTest::testLoadJavaAgent 'testLoadJavaAgent()' STARTED DynamicLoadWarningTest::testLoadOneJvmtiAgent '[1] DynamicLoadWarningTest$$Lambda/0x000000040020bd88@600d90bb' org.opentest4j.AssertionFailedError: expected: <1> but was: <2> at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151) at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132) at org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197) at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:150) at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:145) at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:528) at DynamicLoadWarningTest$AppRunner.stderrShouldContain(DynamicLoadWarningTest.java:298) at DynamicLoadWarningTest.testLoadOneJvmtiAgent(DynamicLoadWarningTest.java:125) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) at java.base/java.lang.reflect.Method.invoke(Method.java:580) Maybe something is missing on AIX ?
06-06-2023

Changeset: 5bd2af26 Author: Alan Bateman <alanb@openjdk.org> Date: 2023-06-02 05:57:01 +0000 URL: https://git.openjdk.org/jdk/commit/5bd2af26e66a863edc670229444b3282ba639563
02-06-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/13899 Date: 2023-05-10 11:12:49 +0000
11-05-2023