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

FileChannel.map() throws IOException for size=0

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.4.0
    • 1.4.0
    • core-libs
    • beta2
    • sparc
    • solaris_7
    • Verified

      Per spec:
      size - The size of the region to be mapped; must be non-negative

      However,
      fc.map(FileChannel.MAP_RO, 0, 0) throws IOException.

      Implementation seems correct, and spec should say:
      size - The size of the region to be mapped; must be greater than 0.

      ------- results ------------
      On Solaris:
      ==========

      java.io.IOException: Invalid argument
              at sun.nio.ch.FileChannelImpl.map0(Native Method)
              at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:386)

      On Windows NT:
      =============
      java.io.IOException: The volume for a file has been externally altered such that the opened file is no longer valid
              at sun.nio.ch.FileChannelImpl.map0(Native Method)
              at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:386)

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

      Merlin Beta B-65

            mmcclosksunw Michael Mccloskey (Inactive)
            hvilekar Harshad Vilekar
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: