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

JDK21 AIX jdk_tools_openj9_DynamicLoadWarningTest_0_FAILED RuntimeException: 'WARNING: A JVM TI agent has been loaded dynamically' found in stderr #18845

Closed
JasonFengJ9 opened this issue Jan 29, 2024 · 2 comments · Fixed by #18881

Comments

@JasonFengJ9
Copy link
Member

Failure link

From an internal build(paix821):

java version "21.0.2" 2024-01-16 LTS
IBM Semeru Runtime Certified Edition 21.0.2.0-rc3 (build 21.0.2+13-LTS)
Eclipse OpenJ9 VM 21.0.2.0-rc3 (build v0.43.0-release-220e78c65, JRE 21 AIX ppc64-64-Bit Compressed References 20240116_90 (JIT enabled, AOT enabled)
OpenJ9   - 220e78c65
OMR      - ea8124dbc
JCL      - 9ac3d866bce based on jdk-21.0.2+13)

Rerun in Grinder - Change TARGET to run only the failed test targets.

Optional info

Failure output (captured from console output)

[2024-01-26T10:27:24.441Z] variation: Mode150
[2024-01-26T10:27:24.441Z] JVM_OPTIONS:  -XX:+UseCompressedOops -Xverbosegclog 

[2024-01-26T10:28:15.882Z] TEST: com/sun/tools/attach/warnings/DynamicLoadWarningTest.java

[2024-01-26T10:28:15.886Z] STARTED    DynamicLoadWarningTest::testLoadOneJvmtiAgent '[1] DynamicLoadWarningTest$$Lambda/0x0000000022d96160@61b56689'
[2024-01-26T10:28:15.886Z]  stdout: [];
[2024-01-26T10:28:15.886Z]  stderr: [WARNING: A JVM TI agent has been loaded dynamically ()
[2024-01-26T10:28:15.886Z] WARNING: If a serviceability tool is in use, please run with -XX:+EnableDynamicAgentLoading to hide this warning
[2024-01-26T10:28:15.886Z] WARNING: If a serviceability tool is not in use, please run with -Djdk.instrument.traceUsage for more information
[2024-01-26T10:28:15.886Z] WARNING: Dynamic loading of agents will be disallowed by default in a future release
[2024-01-26T10:28:15.886Z] ]
[2024-01-26T10:28:15.886Z]  exitValue = 0
[2024-01-26T10:28:15.886Z] 
[2024-01-26T10:28:15.886Z] java.lang.RuntimeException: 'WARNING: A JVM TI agent has been loaded dynamically' found in stderr
[2024-01-26T10:28:15.886Z] 	at jdk.test.lib.process.OutputAnalyzer.stderrShouldNotContain(OutputAnalyzer.java:320)
[2024-01-26T10:28:15.886Z] 	at DynamicLoadWarningTest$AppRunner.stderrShouldNotContain(DynamicLoadWarningTest.java:313)
[2024-01-26T10:28:15.886Z] 	at DynamicLoadWarningTest.testLoadOneJvmtiAgent(DynamicLoadWarningTest.java:137)
[2024-01-26T10:28:15.886Z] 	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
[2024-01-26T10:28:15.886Z] 	at java.base/java.lang.reflect.Method.invoke(Method.java:586)
[2024-01-26T10:28:15.886Z] 	at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:727)
[2024-01-26T10:28:15.886Z] 	at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
[2024-01-26T10:28:15.886Z] 	at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131)
[2024-01-26T10:28:15.886Z] 	at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:156)
[2024-01-26T10:28:15.886Z] 	at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:147)
[2024-01-26T10:28:15.886Z] 	at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestTemplateMethod(TimeoutExtension.java:94)
[2024-01-26T10:28:15.886Z] 	at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(InterceptingExecutableInvoker.java:103)
[2024-01-26T10:28:15.886Z] 	at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.lambda$invoke$0(InterceptingExecutableInvoker.java:93)
[2024-01-26T10:28:15.886Z] 	at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106)
[2024-01-26T10:28:15.886Z] 	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64)
[2024-01-26T10:28:15.886Z] 	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45)
[2024-01-26T10:28:15.887Z] 	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37)
[2024-01-26T10:28:15.887Z] 	at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(InterceptingExecutableInvoker.java:92)
[2024-01-26T10:28:15.887Z] 	at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(InterceptingExecutableInvoker.java:86)
[2024-01-26T10:28:15.887Z] 	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(TestMethodTestDescriptor.java:217)
[2024-01-26T10:28:15.887Z] 	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
[2024-01-26T10:28:15.887Z] 	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:213)
[2024-01-26T10:28:15.887Z] 	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:138)
[2024-01-26T10:28:15.887Z] 	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:68)
[2024-01-26T10:28:15.887Z] 	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:151)
[2024-01-26T10:28:15.887Z] 	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
[2024-01-26T10:28:15.887Z] 	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
[2024-01-26T10:28:15.887Z] 	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
[2024-01-26T10:28:15.887Z] 	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
[2024-01-26T10:28:15.887Z] 	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
[2024-01-26T10:28:15.887Z] 	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
[2024-01-26T10:28:15.887Z] 	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
[2024-01-26T10:28:15.887Z] 	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35)
[2024-01-26T10:28:15.887Z] 	at org.junit.platform.engine.support.hierarchical.NodeTestTask$DefaultDynamicTestExecutor.execute(NodeTestTask.java:226)
[2024-01-26T10:28:15.887Z] 	at org.junit.platform.engine.support.hierarchical.NodeTestTask$DefaultDynamicTestExecutor.execute(NodeTestTask.java:204)
[2024-01-26T10:28:15.887Z] 	at org.junit.jupiter.engine.descriptor.TestTemplateTestDescriptor.execute(TestTemplateTestDescriptor.java:142)
[2024-01-26T10:28:15.887Z] 	at org.junit.jupiter.engine.descriptor.TestTemplateTestDescriptor.lambda$execute$2(TestTemplateTestDescriptor.java:110)
[2024-01-26T10:28:15.887Z] 	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
[2024-01-26T10:28:15.887Z] 	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
[2024-01-26T10:28:15.887Z] 	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
[2024-01-26T10:28:15.887Z] 	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
[2024-01-26T10:28:15.887Z] 	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
[2024-01-26T10:28:15.887Z] 	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
[2024-01-26T10:28:15.887Z] 	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
[2024-01-26T10:28:15.887Z] 	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
[2024-01-26T10:28:15.887Z] 	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
[2024-01-26T10:28:15.887Z] 	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
[2024-01-26T10:28:15.887Z] 	at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:1024)
[2024-01-26T10:28:15.887Z] 	at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:762)
[2024-01-26T10:28:15.887Z] 	at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:276)
[2024-01-26T10:28:15.887Z] 	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
[2024-01-26T10:28:15.887Z] 	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
[2024-01-26T10:28:15.887Z] 	at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:1024)
[2024-01-26T10:28:15.887Z] 	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:522)
[2024-01-26T10:28:15.887Z] 	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:512)
[2024-01-26T10:28:15.887Z] 	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
[2024-01-26T10:28:15.887Z] 	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
[2024-01-26T10:28:15.887Z] 	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:239)
[2024-01-26T10:28:15.887Z] 	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
[2024-01-26T10:28:15.887Z] 	at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:276)
[2024-01-26T10:28:15.887Z] 	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
[2024-01-26T10:28:15.887Z] 	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
[2024-01-26T10:28:15.887Z] 	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
[2024-01-26T10:28:15.887Z] 	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1708)
[2024-01-26T10:28:15.887Z] 	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:522)
[2024-01-26T10:28:15.887Z] 	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:512)
[2024-01-26T10:28:15.887Z] 	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
[2024-01-26T10:28:15.887Z] 	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
[2024-01-26T10:28:15.887Z] 	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:239)
[2024-01-26T10:28:15.887Z] 	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
[2024-01-26T10:28:15.887Z] 	at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:276)
[2024-01-26T10:28:15.887Z] 	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1708)
[2024-01-26T10:28:15.887Z] 	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:522)
[2024-01-26T10:28:15.887Z] 	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:512)
[2024-01-26T10:28:15.887Z] 	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
[2024-01-26T10:28:15.887Z] 	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
[2024-01-26T10:28:15.887Z] 	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:239)
[2024-01-26T10:28:15.887Z] 	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
[2024-01-26T10:28:15.887Z] 	at org.junit.jupiter.engine.descriptor.TestTemplateTestDescriptor.execute(TestTemplateTestDescriptor.java:110)
[2024-01-26T10:28:15.887Z] 	at org.junit.jupiter.engine.descriptor.TestTemplateTestDescriptor.execute(TestTemplateTestDescriptor.java:44)
[2024-01-26T10:28:15.887Z] 	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:151)
[2024-01-26T10:28:15.887Z] 	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
[2024-01-26T10:28:15.887Z] 	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
[2024-01-26T10:28:15.887Z] 	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
[2024-01-26T10:28:15.887Z] 	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
[2024-01-26T10:28:15.887Z] 	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
[2024-01-26T10:28:15.887Z] 	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
[2024-01-26T10:28:15.887Z] 	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
[2024-01-26T10:28:15.887Z] 	at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
[2024-01-26T10:28:15.887Z] 	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
[2024-01-26T10:28:15.887Z] 	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
[2024-01-26T10:28:15.887Z] 	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
[2024-01-26T10:28:15.887Z] 	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
[2024-01-26T10:28:15.887Z] 	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
[2024-01-26T10:28:15.887Z] 	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
[2024-01-26T10:28:15.887Z] 	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
[2024-01-26T10:28:15.887Z] 	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
[2024-01-26T10:28:15.887Z] 	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
[2024-01-26T10:28:15.887Z] 	at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
[2024-01-26T10:28:15.887Z] 	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
[2024-01-26T10:28:15.887Z] 	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
[2024-01-26T10:28:15.887Z] 	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
[2024-01-26T10:28:15.887Z] 	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
[2024-01-26T10:28:15.887Z] 	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
[2024-01-26T10:28:15.887Z] 	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
[2024-01-26T10:28:15.887Z] 	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
[2024-01-26T10:28:15.887Z] 	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
[2024-01-26T10:28:15.887Z] 	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
[2024-01-26T10:28:15.887Z] 	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35)
[2024-01-26T10:28:15.887Z] 	at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
[2024-01-26T10:28:15.887Z] 	at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54)
[2024-01-26T10:28:15.887Z] 	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:147)
[2024-01-26T10:28:15.887Z] 	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:127)
[2024-01-26T10:28:15.887Z] 	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:90)
[2024-01-26T10:28:15.887Z] 	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:55)
[2024-01-26T10:28:15.887Z] 	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:102)
[2024-01-26T10:28:15.887Z] 	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:54)
[2024-01-26T10:28:15.887Z] 	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114)
[2024-01-26T10:28:15.887Z] 	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:86)
[2024-01-26T10:28:15.887Z] 	at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:86)
[2024-01-26T10:28:15.887Z] 	at com.sun.javatest.regtest.agent.JUnitRunner.runWithJUnitPlatform(JUnitRunner.java:142)
[2024-01-26T10:28:15.887Z] 	at com.sun.javatest.regtest.agent.JUnitRunner.main(JUnitRunner.java:95)
[2024-01-26T10:28:15.887Z] 	at com.sun.javatest.regtest.agent.JUnitRunner.main(JUnitRunner.java:61)
[2024-01-26T10:28:15.887Z] 	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
[2024-01-26T10:28:15.887Z] 	at java.base/java.lang.reflect.Method.invoke(Method.java:586)
[2024-01-26T10:28:15.887Z] 	at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138)
[2024-01-26T10:28:15.887Z] 	at java.base/java.lang.Thread.run(Thread.java:1595)
[2024-01-26T10:28:15.887Z] FAILED     DynamicLoadWarningTest::testLoadOneJvmtiAgent '[1] DynamicLoadWarningTest$$Lambda/0x0000000022d96160@61b56689'

[2024-01-26T10:28:29.491Z] jdk_tools_openj9_DynamicLoadWarningTest_0_FAILED

3x re-run automatically launched all failed.

There was a test change introduced 8315706: com/sun/tools/attach/warnings/DynamicLoadWarningTest.java real fix for failure on AIX merged via Merge master jdk-21.0.2+13 into openj9-staging on Jan. 17th.
It didn't appear in earlier milestone builds.

This is part of JEP 451: Prepare to Disallow the Dynamic Loading of Agents.
The test in question starts loadJvmtiAgent1 via the command line, then dynamically loads loadJvmtiAgent1, previously AIX platform was excluded because it can't detect if an agent library was previously loaded.

Considering this is a recent test change, tentatively assign it to 0.44 milestone.

FYI @pshipton @tajila

@JasonFengJ9
Copy link
Member Author

The testcase in question first loads the agent library via a command line option -agentpath:/path/to/agent/libJvmtiAgent1.so, then loads the same library via jcmd AttachAPI command JVMTI.agent_load using a platform independent name JvmtiAgent1.
The test expects that the JVM detects they are the same libraries, and no warning message to be printed because the first loading via a command line option has no warning, and the second loading is for the same library.

The RI AIX fix was proposed at https://mail.openjdk.org/pipermail/hotspot-dev/2023-September/078870.html

The root cause is, that dlopen() on AIX returns different handles every time, even if you load a library twice. There is no official AIX API available to get this information on a different way.
My proposal is, to use the stat64x API with the fields st_device and st_inode. After a dlopen() the stat64x() API is called additionally to get this information which is then stored parallel to the library handle in the jvmtiAgent. For AIX we then can compare these values instead of the library handle and get the same functionality as on linux.

Another option suggested by AIX kernel folks was to use loadquery() to retrieve a list of object files loaded before attempting a platform-independent agent library loading, search the library name, if found, check if its path is in LIBPATH, if so, the library was already loaded. This check can be added along existing

isAgentLibraryLoaded(J9JavaVM *vm, const char *library, BOOLEAN decorate)
{
BOOLEAN result = FALSE;
if (NULL != findAgentLibrary(vm, library, strlen(library))) {
result = TRUE;
} else {
/* J9PORT_SLOPEN_NO_LOAD is only supported on Linux/OSX/Win32 platforms. */
#if defined(LINUX) || defined(OSX) || defined(WIN32)

@zl-wang is this still the way to pursue comparing with RI usage of stat64x API and simulation of dlopen() library searching algorithm?

@zl-wang
Copy link
Contributor

zl-wang commented Jan 30, 2024

@JasonFengJ9 the suggestion sounded reasonable to me moving forward.

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

Successfully merging a pull request may close this issue.

2 participants