On Fri, 9 Jun 2023 13:39:26 GMT, Matthias Baesken <mbaes...@openjdk.org> wrote:

> On AIX ,  new jtreg test  
> com/sun/tools/attach/warnings/DynamicLoadWarningTest.java always failed  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)
> 
> Reason seems to be the different behavior of dlopen on AIX compared to e.g. 
> Linux 
> This is what I find in the manpage of AIX 7.2 or 7.3 :
> https://www.ibm.com/docs/en/aix/7.2?topic=d-dlopen-subroutine
> https://www.ibm.com/docs/en/aix/7.3?topic=d-dlopen-subroutine
> 'If the module is already loaded, it is not loaded again, but a new, unique 
> value will be returned by the dlopen subroutine.'
> 
> Sounds different to what Linux documents in the manpage:
> https://man7.org/linux/man-pages/man3/dlopen.3.html
> 'If the same shared object is opened again with dlopen(), the same object 
> handle is returned.'
> 
> We skip this special subtest on AIX .

Thanks for taking this one. The spec doesn't require warnings be de-duplicated 
when the same agent library is loaded more than once, thus skipping this test 
is okay where it's too complex to detect that the agent library is already 
loaded.

-------------

Marked as reviewed by alanb (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/14393#pullrequestreview-1472159054

Reply via email to