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

DirectIOTest fails on a system with large block size

XMLWordPrintable

    • b19
    • linux

        The test fails with following exception if 'alignment' returned by FileStore::getBlockSize exceeds the test constant SIZE:

        java.nio.BufferOverflowException
        at java.base/java.nio.Buffer.nextPutIndex(Buffer.java:
        at java.base/java.nio.DirectByteBuffer.put(DirectByteBuffer.java:
        at DirectIOTest.testWrite(DirectIOTest.java:
        at DirectIOTest.main(DirectIOTest.java:

        This happens due to ByteBuffer.allocateDirect(SIZE + alignment - 1) .alignedSlice(alignment) returns zero-length buffer.

              bpb Brian Burkhalter
              snazarki Sergey Nazarkin
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: