Uploaded image for project: 'Code Tools'
  1. Code Tools
  2. CODETOOLS-7115576

On Windows: 2008, NIO truncate0 fails because of security manager

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3
    • jt4.4.1
    • jt4.4.1
    • tools
    • b12
    • generic
    • windows_7
    • Verified

    Description

      On Windows: 2008, 7 and later user should specify option -Djavatest.security.allowPropertiesAccess otherwise all tests will fail:
      java.io.IOException: The requested operation cannot be performed on a file with
      a user-mapped section open
              at sun.nio.ch.FileDispatcherImpl.truncate0(Native Method)
              at sun.nio.ch.FileDispatcherImpl.truncate(FileDispatcherImpl.java:91)
              at sun.nio.ch.FileChannelImpl.truncate(FileChannelImpl.java:333)
              at com.sun.javatest.TestResultCache.doWork(TestResultCache.java:327)
              at com.sun.javatest.TestResultCache.doWorkUntilDone(TestResultCache.jav
      :233)
              at com.sun.javatest.TestResultCache.access$000(TestResultCache.java:54)
              at com.sun.javatest.TestResultCache$1.run(TestResultCache.java:146)
      Fix failed. See next comment.
      The following exception constantly appears on Windows:
      An unrecoverable error happened while processing the test result cache (java.io.
      IOException: The requested operation cannot be performed on a file with a user-m
      apped section open)
      java.io.IOException: The requested operation cannot be performed on a file with
      a user-mapped section open
              at sun.nio.ch.FileDispatcherImpl.truncate0(Native Method)
              at sun.nio.ch.FileDispatcherImpl.truncate(FileDispatcherImpl.java:91)
              at sun.nio.ch.FileChannelImpl.truncate(FileChannelImpl.java:333)
              at com.sun.javatest.TestResultCache.trunkIt(TestResultCache.java:385)
              at com.sun.javatest.TestResultCache.writeCache(TestResultCache.java:722)

              at com.sun.javatest.TestResultCache.doWork(TestResultCache.java:350)
              at com.sun.javatest.TestResultCache.doWorkUntilDone(TestResultCache.java
      :233)
              at com.sun.javatest.TestResultCache.access$000(TestResultCache.java:54)
              at com.sun.javatest.TestResultCache$1.run(TestResultCache.java:146)

      It has nothing to do with security manager. The following steps reproduce the problem:
      1. Open and start some test from testsuite
      2. Stop execution before it is done
      3. Exception will be thrown
      4. All work with this workdir will be accompanied with exceptions because ResultCache2 will be corrupted.

      Attachments

        Activity

          People

            bkurotsu Brian Kurotsuchi (Inactive)
            mkolmako Maxim Kolmakov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: