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

java/io/File/GetXSpace.java fails on Windows with CD-ROM drive

XMLWordPrintable

    • b05
    • windows

        On Windows Server 2019, if the drive retrieved by File.listRoots() is assigned as a CD-ROM drive and the disk is not mounted, GetXSpace.java fails with the following stack and the message "The device is not ready":

        ----------System.err:(23/1555)----------
        WARNING: A restricted method in java.lang.System has been called
        WARNING: java.lang.System::loadLibrary has been called by GetXSpace in an unnamed module (file:/C:/work/kurashige/GetXSpace/JTwork/classes/java/io/File/GetXSpace.d/)
        WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module
        WARNING: Restricted methods will be blocked in a future release unless native access is enabled

        WARNING: A terminally deprecated method in java.lang.System has been called
        WARNING: System::setSecurityManager has been called by GetXSpace (file:/C:/work/kurashige/GetXSpace/JTwork/classes/java/io/File/GetXSpace.d/)
        WARNING: Please consider reporting this to the maintainers of GetXSpace
        WARNING: System::setSecurityManager will be removed in a future release
        java.lang.RuntimeException: The device is not ready
        at GetXSpace.getSpace0(Native Method)
        at GetXSpace$Space.<init>(GetXSpace.java:112)
        at GetXSpace.testVolumes(GetXSpace.java:431)
        at GetXSpace.main(GetXSpace.java:469)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
        at java.base/java.lang.reflect.Method.invoke(Method.java:573)
        at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138)
        at java.base/java.lang.Thread.run(Thread.java:1576)


        In addition, if the disk is mounted, GetXSpace.java fails with the following stack and the message "The parameter is incorrect":

        ----------System.err:(23/1564)----------
        WARNING: A restricted method in java.lang.System has been called
        WARNING: java.lang.System::loadLibrary has been called by GetXSpace in an unnamed module (file:/C:/work/kurashige/GetXSpace/JTwork/classes/java/io/File/GetXSpace.d/)
        WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module
        WARNING: Restricted methods will be blocked in a future release unless native access is enabled

        WARNING: A terminally deprecated method in java.lang.System has been called
        WARNING: System::setSecurityManager has been called by GetXSpace (file:/C:/work/kurashige/GetXSpace/JTwork/classes/java/io/File/GetXSpace.d/)
        WARNING: Please consider reporting this to the maintainers of GetXSpace
        WARNING: System::setSecurityManager will be removed in a future release
        java.lang.RuntimeException: The parameter is incorrect
        at GetXSpace.getSpace0(Native Method)
        at GetXSpace$Space.<init>(GetXSpace.java:112)
        at GetXSpace.testVolumes(GetXSpace.java:431)
        at GetXSpace.main(GetXSpace.java:469)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
        at java.base/java.lang.reflect.Method.invoke(Method.java:573)
        at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138)
        at java.base/java.lang.Thread.run(Thread.java:1576)

        This happens because GetDiskSpaceInformationW function in libGetXSpace.c fails to get information about the size of the drive to which a CD-ROM drive is assigned.

        Above errors have also been reported at https://github.com/openjdk/jdk/pull/12397#issuecomment-1705164515 but have not been resolved.

        GetXSpace.java is a test for File.get-X-Space methods. These methods can get information about the size of the CD-ROM drive. Therefore, if the target drive for the test is a CD-ROM drive, the test should be run without the above errors.

              tkiriyama Takuya Kiriyama
              tkiriyama Takuya Kiriyama
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: