Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8309475

Test java/foreign/TestByteBuffer.java fails: a problem with msync (aix)

    XMLWordPrintable

Details

    • b12
    • aix
    • Verified

    Backports

      Description

        Test java/foreign/TestByteBuffer.java fails on AIX in subtest testMappedSegmentAsByteBuffer. Native C-method msync() returns with errno EINVAL because flag MS_SYNC is set although the preceding call for mmap issued mode MAP_PRIVATE. This is working as documented for AIX (msync Subroutine - IBM Documentation). Other Unix implementations like linux do not have this restriction.
         
        According to javadoc of the calling java method java.base/java/nio/MappedByteBuffer.force() (MappedByteBuffer (Java SE 21 & JDK 21 [build 25])) this combination of flags should be allowed to result in a noop call of force(). Therefore, the failing call of msync should be avoided at least for AIX if according mmap was using flag MAP_PRIVATE.
         
        Problem: in the current sequence of calls, this information is not available in the method calling msync().


        java.io.UncheckedIOException: java.io.IOException: Invalid argument (msync with parameter MS_SYNC failed)
        at java.base/java.nio.MappedMemoryUtils.force(MappedMemoryUtils.java:105)
        at java.base/java.nio.Buffer$2.force(Buffer.java:890)
        at java.base/jdk.internal.misc.ScopedMemoryAccess.forceInternal(ScopedMemoryAccess.java:317)
        at java.base/jdk.internal.misc.ScopedMemoryAccess.force(ScopedMemoryAccess.java:305)
        at java.base/jdk.internal.foreign.MappedMemorySegmentImpl.force(MappedMemorySegmentImpl.java:92)
        at TestByteBuffer.testMappedSegmentAsByteBuffer(TestByteBuffer.java:321)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
        at java.base/java.lang.reflect.Method.invoke(Method.java:580)
        at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:132)
        at org.testng.internal.TestInvoker.invokeMethod(TestInvoker.java:599)
        at org.testng.internal.TestInvoker.invokeTestMethod(TestInvoker.java:174)
        at org.testng.internal.MethodRunner.runInSequence(MethodRunner.java:46)
        at org.testng.internal.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:822)
        at org.testng.internal.TestInvoker.invokeTestMethods(TestInvoker.java:147)
        at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:146)
        at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:128)
        at java.base/java.util.ArrayList.forEach(ArrayList.java:1593)
        at org.testng.TestRunner.privateRun(TestRunner.java:764)
        at org.testng.TestRunner.run(TestRunner.java:585)
        at org.testng.SuiteRunner.runTest(SuiteRunner.java:384)
        at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:378)
        at org.testng.SuiteRunner.privateRun(SuiteRunner.java:337)
        at org.testng.SuiteRunner.run(SuiteRunner.java:286)
        at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:53)
        at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:96)
        at org.testng.TestNG.runSuitesSequentially(TestNG.java:1218)
        at org.testng.TestNG.runSuitesLocally(TestNG.java:1140)
        at org.testng.TestNG.runSuites(TestNG.java:1069)
        at org.testng.TestNG.run(TestNG.java:1037)
        at com.sun.javatest.regtest.agent.TestNGRunner.main(TestNGRunner.java:102)
        at com.sun.javatest.regtest.agent.TestNGRunner.main(TestNGRunner.java:58)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
        at java.base/java.lang.reflect.Method.invoke(Method.java:580)
        at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138)
        at java.base/java.lang.Thread.run(Thread.java:1583)
        Caused by: java.io.IOException: Invalid argument (msync with parameter MS_SYNC failed)
        at java.base/java.nio.MappedMemoryUtils.force0(Native Method)
        at java.base/java.nio.MappedMemoryUtils.force(MappedMemoryUtils.java:103)
        ... 34 more

        Attachments

          Issue Links

            There are no Sub-Tasks for this issue.

            Activity

              People

                tsteele Tyler Steele
                goetz Goetz Lindenmaier
                Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: