You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Nikolay Kuznetsov (JIRA)" <ji...@apache.org> on 2006/12/05 17:56:22 UTC

[jira] Created: (HARMONY-2476) [classlib][nio]FileChannel.read(ByteBuffer) does not throw IOException if underlying file is locked.

[classlib][nio]FileChannel.read(ByteBuffer) does not throw IOException if underlying file is locked.
----------------------------------------------------------------------------------------------------

                 Key: HARMONY-2476
                 URL: http://issues.apache.org/jira/browse/HARMONY-2476
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
            Reporter: Nikolay Kuznetsov
         Attachments: test.java

An attempt to access a file which is locked by FileChannel.lock() according to RI behavior should result in IOException, attached test demonstrates this problem:
RI output
java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64):

Start
java.io.IOException: The process cannot access the file because another process has locked a portion of the file
        at jrockit.io.FileNativeIO.read(III)I(Native Method)
        at jrockit.io.NativeIO.read(Ljava.io.FileDescriptor;II)I(Unknown Source)
        at jrockit.nio.ch.IOUtil.read(Ljava.io.FileDescriptor;IIJLjrockit.io.NativeIO;Ljava.lang.Object;)I(Unknown Source)
        at jrockit.nio.ch.IOUtil.read(Ljava.io.FileDescriptor;Ljrockit.io.IOMemory;IJLjrockit.io.NativeIO;Ljava.lang.Object;)I(Unknown Source)
        at jrockit.nio.ch.IOUtil.read(Ljava.io.FileDescriptor;Ljava.nio.ByteBuffer;JLjrockit.io.NativeIO;Ljava.lang.Object;)I(Unknown Source)
        at jrockit.nio.ch.FileChannelImpl.read(Ljava.nio.ByteBuffer;)I(Unknown Source)
        at test.testLockAndTryLock(test.java:47)
        at test.main(test.java:9)
PASS

HARMONY output:
Start
Must throw IOException, because file is locked

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (HARMONY-2476) [classlib][nio]FileChannel.read(ByteBuffer) does not throw IOException if underlying file is locked.

Posted by "Tony Wu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-2476?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tony Wu updated HARMONY-2476:
-----------------------------

    Attachment: harmony-2476-nio_newtestfile_win32.diff

> [classlib][nio]FileChannel.read(ByteBuffer) does not throw IOException if underlying file is locked.
> ----------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2476
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2476
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Nikolay Kuznetsov
>         Attachments: harmony-2476-luni.diff, harmony-2476-nio.diff, harmony-2476-nio_newtestfile_win32.diff, harmony-2476-portlib.diff, test.java
>
>
> An attempt to access a file which is locked by FileChannel.lock() according to RI behavior should result in IOException, attached test demonstrates this problem:
> RI output
> java version "1.5.0"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64):
> Start
> java.io.IOException: The process cannot access the file because another process has locked a portion of the file
>         at jrockit.io.FileNativeIO.read(III)I(Native Method)
>         at jrockit.io.NativeIO.read(Ljava.io.FileDescriptor;II)I(Unknown Source)
>         at jrockit.nio.ch.IOUtil.read(Ljava.io.FileDescriptor;IIJLjrockit.io.NativeIO;Ljava.lang.Object;)I(Unknown Source)
>         at jrockit.nio.ch.IOUtil.read(Ljava.io.FileDescriptor;Ljrockit.io.IOMemory;IJLjrockit.io.NativeIO;Ljava.lang.Object;)I(Unknown Source)
>         at jrockit.nio.ch.IOUtil.read(Ljava.io.FileDescriptor;Ljava.nio.ByteBuffer;JLjrockit.io.NativeIO;Ljava.lang.Object;)I(Unknown Source)
>         at jrockit.nio.ch.FileChannelImpl.read(Ljava.nio.ByteBuffer;)I(Unknown Source)
>         at test.testLockAndTryLock(test.java:47)
>         at test.main(test.java:9)
> PASS
> HARMONY output:
> Start
> Must throw IOException, because file is locked

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-2476) [classlib][nio]FileChannel.read(ByteBuffer) does not throw IOException if underlying file is locked.

Posted by "Tony Wu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-2476?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tony Wu updated HARMONY-2476:
-----------------------------

    Attachment: harmony-2476-all-in-one.diff

upload an all-in-one patch for convenience

> [classlib][nio]FileChannel.read(ByteBuffer) does not throw IOException if underlying file is locked.
> ----------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2476
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2476
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Nikolay Kuznetsov
>         Assigned To: Richard Liang
>         Attachments: harmony-2476-all-in-one.diff, harmony-2476-luni.diff, harmony-2476-nio.diff, harmony-2476-nio_newtestfile_win32.diff, harmony-2476-portlib.diff, harmony-2476-portlib.diff, test.java
>
>
> An attempt to access a file which is locked by FileChannel.lock() according to RI behavior should result in IOException, attached test demonstrates this problem:
> RI output
> java version "1.5.0"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64):
> Start
> java.io.IOException: The process cannot access the file because another process has locked a portion of the file
>         at jrockit.io.FileNativeIO.read(III)I(Native Method)
>         at jrockit.io.NativeIO.read(Ljava.io.FileDescriptor;II)I(Unknown Source)
>         at jrockit.nio.ch.IOUtil.read(Ljava.io.FileDescriptor;IIJLjrockit.io.NativeIO;Ljava.lang.Object;)I(Unknown Source)
>         at jrockit.nio.ch.IOUtil.read(Ljava.io.FileDescriptor;Ljrockit.io.IOMemory;IJLjrockit.io.NativeIO;Ljava.lang.Object;)I(Unknown Source)
>         at jrockit.nio.ch.IOUtil.read(Ljava.io.FileDescriptor;Ljava.nio.ByteBuffer;JLjrockit.io.NativeIO;Ljava.lang.Object;)I(Unknown Source)
>         at jrockit.nio.ch.FileChannelImpl.read(Ljava.nio.ByteBuffer;)I(Unknown Source)
>         at test.testLockAndTryLock(test.java:47)
>         at test.main(test.java:9)
> PASS
> HARMONY output:
> Start
> Must throw IOException, because file is locked

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-2476) [classlib][nio]FileChannel.read(ByteBuffer) does not throw IOException if underlying file is locked.

Posted by "Tony Wu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-2476?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tony Wu updated HARMONY-2476:
-----------------------------

    Attachment: harmony-2476-nio.diff

> [classlib][nio]FileChannel.read(ByteBuffer) does not throw IOException if underlying file is locked.
> ----------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2476
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2476
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Nikolay Kuznetsov
>         Attachments: harmony-2476-luni.diff, harmony-2476-nio.diff, harmony-2476-portlib.diff, test.java
>
>
> An attempt to access a file which is locked by FileChannel.lock() according to RI behavior should result in IOException, attached test demonstrates this problem:
> RI output
> java version "1.5.0"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64):
> Start
> java.io.IOException: The process cannot access the file because another process has locked a portion of the file
>         at jrockit.io.FileNativeIO.read(III)I(Native Method)
>         at jrockit.io.NativeIO.read(Ljava.io.FileDescriptor;II)I(Unknown Source)
>         at jrockit.nio.ch.IOUtil.read(Ljava.io.FileDescriptor;IIJLjrockit.io.NativeIO;Ljava.lang.Object;)I(Unknown Source)
>         at jrockit.nio.ch.IOUtil.read(Ljava.io.FileDescriptor;Ljrockit.io.IOMemory;IJLjrockit.io.NativeIO;Ljava.lang.Object;)I(Unknown Source)
>         at jrockit.nio.ch.IOUtil.read(Ljava.io.FileDescriptor;Ljava.nio.ByteBuffer;JLjrockit.io.NativeIO;Ljava.lang.Object;)I(Unknown Source)
>         at jrockit.nio.ch.FileChannelImpl.read(Ljava.nio.ByteBuffer;)I(Unknown Source)
>         at test.testLockAndTryLock(test.java:47)
>         at test.main(test.java:9)
> PASS
> HARMONY output:
> Start
> Must throw IOException, because file is locked

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-2476) [classlib][nio]FileChannel.read(ByteBuffer) does not throw IOException if underlying file is locked.

Posted by "Tony Wu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-2476?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tony Wu updated HARMONY-2476:
-----------------------------

    Attachment: harmony-2476-portlib.diff

> [classlib][nio]FileChannel.read(ByteBuffer) does not throw IOException if underlying file is locked.
> ----------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2476
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2476
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Nikolay Kuznetsov
>         Attachments: harmony-2476-luni.diff, harmony-2476-nio.diff, harmony-2476-portlib.diff, test.java
>
>
> An attempt to access a file which is locked by FileChannel.lock() according to RI behavior should result in IOException, attached test demonstrates this problem:
> RI output
> java version "1.5.0"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64):
> Start
> java.io.IOException: The process cannot access the file because another process has locked a portion of the file
>         at jrockit.io.FileNativeIO.read(III)I(Native Method)
>         at jrockit.io.NativeIO.read(Ljava.io.FileDescriptor;II)I(Unknown Source)
>         at jrockit.nio.ch.IOUtil.read(Ljava.io.FileDescriptor;IIJLjrockit.io.NativeIO;Ljava.lang.Object;)I(Unknown Source)
>         at jrockit.nio.ch.IOUtil.read(Ljava.io.FileDescriptor;Ljrockit.io.IOMemory;IJLjrockit.io.NativeIO;Ljava.lang.Object;)I(Unknown Source)
>         at jrockit.nio.ch.IOUtil.read(Ljava.io.FileDescriptor;Ljava.nio.ByteBuffer;JLjrockit.io.NativeIO;Ljava.lang.Object;)I(Unknown Source)
>         at jrockit.nio.ch.FileChannelImpl.read(Ljava.nio.ByteBuffer;)I(Unknown Source)
>         at test.testLockAndTryLock(test.java:47)
>         at test.main(test.java:9)
> PASS
> HARMONY output:
> Start
> Must throw IOException, because file is locked

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-2476) [classlib][nio]FileChannel.read(ByteBuffer) does not throw IOException if underlying file is locked.

Posted by "Tony Wu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-2476?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tony Wu updated HARMONY-2476:
-----------------------------

    Attachment: harmony-2476-portlib.diff

new portlib patch, thanks.

> [classlib][nio]FileChannel.read(ByteBuffer) does not throw IOException if underlying file is locked.
> ----------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2476
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2476
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Nikolay Kuznetsov
>         Assigned To: Richard Liang
>         Attachments: harmony-2476-luni.diff, harmony-2476-nio.diff, harmony-2476-nio_newtestfile_win32.diff, harmony-2476-portlib.diff, harmony-2476-portlib.diff, test.java
>
>
> An attempt to access a file which is locked by FileChannel.lock() according to RI behavior should result in IOException, attached test demonstrates this problem:
> RI output
> java version "1.5.0"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64):
> Start
> java.io.IOException: The process cannot access the file because another process has locked a portion of the file
>         at jrockit.io.FileNativeIO.read(III)I(Native Method)
>         at jrockit.io.NativeIO.read(Ljava.io.FileDescriptor;II)I(Unknown Source)
>         at jrockit.nio.ch.IOUtil.read(Ljava.io.FileDescriptor;IIJLjrockit.io.NativeIO;Ljava.lang.Object;)I(Unknown Source)
>         at jrockit.nio.ch.IOUtil.read(Ljava.io.FileDescriptor;Ljrockit.io.IOMemory;IJLjrockit.io.NativeIO;Ljava.lang.Object;)I(Unknown Source)
>         at jrockit.nio.ch.IOUtil.read(Ljava.io.FileDescriptor;Ljava.nio.ByteBuffer;JLjrockit.io.NativeIO;Ljava.lang.Object;)I(Unknown Source)
>         at jrockit.nio.ch.FileChannelImpl.read(Ljava.nio.ByteBuffer;)I(Unknown Source)
>         at test.testLockAndTryLock(test.java:47)
>         at test.main(test.java:9)
> PASS
> HARMONY output:
> Start
> Must throw IOException, because file is locked

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-2476) [classlib][nio]FileChannel.read(ByteBuffer) does not throw IOException if underlying file is locked.

Posted by "Tony Wu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-2476?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12471204 ] 

Tony Wu commented on HARMONY-2476:
----------------------------------

patch & test.
Note that this issue fails on linux system also, because the lock on linux is advisory. This means that cooperating processes may use locks to coordinate access to a file between themselves, but programs are also free to ignore locks and access the file in any way they choose to.
would you please try them? Thanks a lot!

> [classlib][nio]FileChannel.read(ByteBuffer) does not throw IOException if underlying file is locked.
> ----------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2476
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2476
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Nikolay Kuznetsov
>         Attachments: harmony-2476-luni.diff, harmony-2476-nio.diff, harmony-2476-portlib.diff, test.java
>
>
> An attempt to access a file which is locked by FileChannel.lock() according to RI behavior should result in IOException, attached test demonstrates this problem:
> RI output
> java version "1.5.0"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64):
> Start
> java.io.IOException: The process cannot access the file because another process has locked a portion of the file
>         at jrockit.io.FileNativeIO.read(III)I(Native Method)
>         at jrockit.io.NativeIO.read(Ljava.io.FileDescriptor;II)I(Unknown Source)
>         at jrockit.nio.ch.IOUtil.read(Ljava.io.FileDescriptor;IIJLjrockit.io.NativeIO;Ljava.lang.Object;)I(Unknown Source)
>         at jrockit.nio.ch.IOUtil.read(Ljava.io.FileDescriptor;Ljrockit.io.IOMemory;IJLjrockit.io.NativeIO;Ljava.lang.Object;)I(Unknown Source)
>         at jrockit.nio.ch.IOUtil.read(Ljava.io.FileDescriptor;Ljava.nio.ByteBuffer;JLjrockit.io.NativeIO;Ljava.lang.Object;)I(Unknown Source)
>         at jrockit.nio.ch.FileChannelImpl.read(Ljava.nio.ByteBuffer;)I(Unknown Source)
>         at test.testLockAndTryLock(test.java:47)
>         at test.main(test.java:9)
> PASS
> HARMONY output:
> Start
> Must throw IOException, because file is locked

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-2476) [classlib][nio]FileChannel.read(ByteBuffer) does not throw IOException if underlying file is locked.

Posted by "Tony Wu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-2476?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12471213 ] 

Tony Wu commented on HARMONY-2476:
----------------------------------

If it is ok to add a new file for win32 only test and modify the exclude list, please have a look at the harmony-2476-nio_newtestfile_win32.diff and ignore the harmony-2476-nio.diff.


> [classlib][nio]FileChannel.read(ByteBuffer) does not throw IOException if underlying file is locked.
> ----------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2476
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2476
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Nikolay Kuznetsov
>         Attachments: harmony-2476-luni.diff, harmony-2476-nio.diff, harmony-2476-nio_newtestfile_win32.diff, harmony-2476-portlib.diff, test.java
>
>
> An attempt to access a file which is locked by FileChannel.lock() according to RI behavior should result in IOException, attached test demonstrates this problem:
> RI output
> java version "1.5.0"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64):
> Start
> java.io.IOException: The process cannot access the file because another process has locked a portion of the file
>         at jrockit.io.FileNativeIO.read(III)I(Native Method)
>         at jrockit.io.NativeIO.read(Ljava.io.FileDescriptor;II)I(Unknown Source)
>         at jrockit.nio.ch.IOUtil.read(Ljava.io.FileDescriptor;IIJLjrockit.io.NativeIO;Ljava.lang.Object;)I(Unknown Source)
>         at jrockit.nio.ch.IOUtil.read(Ljava.io.FileDescriptor;Ljrockit.io.IOMemory;IJLjrockit.io.NativeIO;Ljava.lang.Object;)I(Unknown Source)
>         at jrockit.nio.ch.IOUtil.read(Ljava.io.FileDescriptor;Ljava.nio.ByteBuffer;JLjrockit.io.NativeIO;Ljava.lang.Object;)I(Unknown Source)
>         at jrockit.nio.ch.FileChannelImpl.read(Ljava.nio.ByteBuffer;)I(Unknown Source)
>         at test.testLockAndTryLock(test.java:47)
>         at test.main(test.java:9)
> PASS
> HARMONY output:
> Start
> Must throw IOException, because file is locked

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-2476) [classlib][nio]FileChannel.read(ByteBuffer) does not throw IOException if underlying file is locked.

Posted by "Tony Wu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-2476?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12471206 ] 

Tony Wu commented on HARMONY-2476:
----------------------------------

So, please ingore the testcase otherwise it will fail on linux.

> [classlib][nio]FileChannel.read(ByteBuffer) does not throw IOException if underlying file is locked.
> ----------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2476
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2476
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Nikolay Kuznetsov
>         Attachments: harmony-2476-luni.diff, harmony-2476-nio.diff, harmony-2476-portlib.diff, test.java
>
>
> An attempt to access a file which is locked by FileChannel.lock() according to RI behavior should result in IOException, attached test demonstrates this problem:
> RI output
> java version "1.5.0"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64):
> Start
> java.io.IOException: The process cannot access the file because another process has locked a portion of the file
>         at jrockit.io.FileNativeIO.read(III)I(Native Method)
>         at jrockit.io.NativeIO.read(Ljava.io.FileDescriptor;II)I(Unknown Source)
>         at jrockit.nio.ch.IOUtil.read(Ljava.io.FileDescriptor;IIJLjrockit.io.NativeIO;Ljava.lang.Object;)I(Unknown Source)
>         at jrockit.nio.ch.IOUtil.read(Ljava.io.FileDescriptor;Ljrockit.io.IOMemory;IJLjrockit.io.NativeIO;Ljava.lang.Object;)I(Unknown Source)
>         at jrockit.nio.ch.IOUtil.read(Ljava.io.FileDescriptor;Ljava.nio.ByteBuffer;JLjrockit.io.NativeIO;Ljava.lang.Object;)I(Unknown Source)
>         at jrockit.nio.ch.FileChannelImpl.read(Ljava.nio.ByteBuffer;)I(Unknown Source)
>         at test.testLockAndTryLock(test.java:47)
>         at test.main(test.java:9)
> PASS
> HARMONY output:
> Start
> Must throw IOException, because file is locked

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-2476) [classlib][nio]FileChannel.read(ByteBuffer) does not throw IOException if underlying file is locked.

Posted by "Tony Wu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-2476?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tony Wu updated HARMONY-2476:
-----------------------------

    Attachment: harmony-2476-luni.diff

> [classlib][nio]FileChannel.read(ByteBuffer) does not throw IOException if underlying file is locked.
> ----------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2476
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2476
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Nikolay Kuznetsov
>         Attachments: harmony-2476-luni.diff, test.java
>
>
> An attempt to access a file which is locked by FileChannel.lock() according to RI behavior should result in IOException, attached test demonstrates this problem:
> RI output
> java version "1.5.0"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64):
> Start
> java.io.IOException: The process cannot access the file because another process has locked a portion of the file
>         at jrockit.io.FileNativeIO.read(III)I(Native Method)
>         at jrockit.io.NativeIO.read(Ljava.io.FileDescriptor;II)I(Unknown Source)
>         at jrockit.nio.ch.IOUtil.read(Ljava.io.FileDescriptor;IIJLjrockit.io.NativeIO;Ljava.lang.Object;)I(Unknown Source)
>         at jrockit.nio.ch.IOUtil.read(Ljava.io.FileDescriptor;Ljrockit.io.IOMemory;IJLjrockit.io.NativeIO;Ljava.lang.Object;)I(Unknown Source)
>         at jrockit.nio.ch.IOUtil.read(Ljava.io.FileDescriptor;Ljava.nio.ByteBuffer;JLjrockit.io.NativeIO;Ljava.lang.Object;)I(Unknown Source)
>         at jrockit.nio.ch.FileChannelImpl.read(Ljava.nio.ByteBuffer;)I(Unknown Source)
>         at test.testLockAndTryLock(test.java:47)
>         at test.main(test.java:9)
> PASS
> HARMONY output:
> Start
> Must throw IOException, because file is locked

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-2476) [classlib][nio]FileChannel.read(ByteBuffer) does not throw IOException if underlying file is locked.

Posted by "Tony Wu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-2476?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tony Wu updated HARMONY-2476:
-----------------------------

    Attachment: harmony-2476-all-in-one-2.diff

sorry I forgot to add it into linux exlude lists, please try the all-in-one-2. Thanks.

> [classlib][nio]FileChannel.read(ByteBuffer) does not throw IOException if underlying file is locked.
> ----------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2476
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2476
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Nikolay Kuznetsov
>         Assigned To: Richard Liang
>         Attachments: harmony-2476-all-in-one-2.diff, harmony-2476-all-in-one.diff, harmony-2476-luni.diff, harmony-2476-nio.diff, harmony-2476-nio_newtestfile_win32.diff, harmony-2476-portlib.diff, harmony-2476-portlib.diff, test.java
>
>
> An attempt to access a file which is locked by FileChannel.lock() according to RI behavior should result in IOException, attached test demonstrates this problem:
> RI output
> java version "1.5.0"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64):
> Start
> java.io.IOException: The process cannot access the file because another process has locked a portion of the file
>         at jrockit.io.FileNativeIO.read(III)I(Native Method)
>         at jrockit.io.NativeIO.read(Ljava.io.FileDescriptor;II)I(Unknown Source)
>         at jrockit.nio.ch.IOUtil.read(Ljava.io.FileDescriptor;IIJLjrockit.io.NativeIO;Ljava.lang.Object;)I(Unknown Source)
>         at jrockit.nio.ch.IOUtil.read(Ljava.io.FileDescriptor;Ljrockit.io.IOMemory;IJLjrockit.io.NativeIO;Ljava.lang.Object;)I(Unknown Source)
>         at jrockit.nio.ch.IOUtil.read(Ljava.io.FileDescriptor;Ljava.nio.ByteBuffer;JLjrockit.io.NativeIO;Ljava.lang.Object;)I(Unknown Source)
>         at jrockit.nio.ch.FileChannelImpl.read(Ljava.nio.ByteBuffer;)I(Unknown Source)
>         at test.testLockAndTryLock(test.java:47)
>         at test.main(test.java:9)
> PASS
> HARMONY output:
> Start
> Must throw IOException, because file is locked

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-2476) [classlib][nio]FileChannel.read(ByteBuffer) does not throw IOException if underlying file is locked.

Posted by "Nikolay Kuznetsov (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-2476?page=all ]

Nikolay Kuznetsov updated HARMONY-2476:
---------------------------------------

    Attachment: test.java

> [classlib][nio]FileChannel.read(ByteBuffer) does not throw IOException if underlying file is locked.
> ----------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2476
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2476
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Nikolay Kuznetsov
>         Attachments: test.java
>
>
> An attempt to access a file which is locked by FileChannel.lock() according to RI behavior should result in IOException, attached test demonstrates this problem:
> RI output
> java version "1.5.0"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64):
> Start
> java.io.IOException: The process cannot access the file because another process has locked a portion of the file
>         at jrockit.io.FileNativeIO.read(III)I(Native Method)
>         at jrockit.io.NativeIO.read(Ljava.io.FileDescriptor;II)I(Unknown Source)
>         at jrockit.nio.ch.IOUtil.read(Ljava.io.FileDescriptor;IIJLjrockit.io.NativeIO;Ljava.lang.Object;)I(Unknown Source)
>         at jrockit.nio.ch.IOUtil.read(Ljava.io.FileDescriptor;Ljrockit.io.IOMemory;IJLjrockit.io.NativeIO;Ljava.lang.Object;)I(Unknown Source)
>         at jrockit.nio.ch.IOUtil.read(Ljava.io.FileDescriptor;Ljava.nio.ByteBuffer;JLjrockit.io.NativeIO;Ljava.lang.Object;)I(Unknown Source)
>         at jrockit.nio.ch.FileChannelImpl.read(Ljava.nio.ByteBuffer;)I(Unknown Source)
>         at test.testLockAndTryLock(test.java:47)
>         at test.main(test.java:9)
> PASS
> HARMONY output:
> Start
> Must throw IOException, because file is locked

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Assigned: (HARMONY-2476) [classlib][nio]FileChannel.read(ByteBuffer) does not throw IOException if underlying file is locked.

Posted by "Richard Liang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-2476?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Richard Liang reassigned HARMONY-2476:
--------------------------------------

    Assignee: Richard Liang

> [classlib][nio]FileChannel.read(ByteBuffer) does not throw IOException if underlying file is locked.
> ----------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2476
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2476
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Nikolay Kuznetsov
>         Assigned To: Richard Liang
>         Attachments: harmony-2476-luni.diff, harmony-2476-nio.diff, harmony-2476-nio_newtestfile_win32.diff, harmony-2476-portlib.diff, test.java
>
>
> An attempt to access a file which is locked by FileChannel.lock() according to RI behavior should result in IOException, attached test demonstrates this problem:
> RI output
> java version "1.5.0"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64):
> Start
> java.io.IOException: The process cannot access the file because another process has locked a portion of the file
>         at jrockit.io.FileNativeIO.read(III)I(Native Method)
>         at jrockit.io.NativeIO.read(Ljava.io.FileDescriptor;II)I(Unknown Source)
>         at jrockit.nio.ch.IOUtil.read(Ljava.io.FileDescriptor;IIJLjrockit.io.NativeIO;Ljava.lang.Object;)I(Unknown Source)
>         at jrockit.nio.ch.IOUtil.read(Ljava.io.FileDescriptor;Ljrockit.io.IOMemory;IJLjrockit.io.NativeIO;Ljava.lang.Object;)I(Unknown Source)
>         at jrockit.nio.ch.IOUtil.read(Ljava.io.FileDescriptor;Ljava.nio.ByteBuffer;JLjrockit.io.NativeIO;Ljava.lang.Object;)I(Unknown Source)
>         at jrockit.nio.ch.FileChannelImpl.read(Ljava.nio.ByteBuffer;)I(Unknown Source)
>         at test.testLockAndTryLock(test.java:47)
>         at test.main(test.java:9)
> PASS
> HARMONY output:
> Start
> Must throw IOException, because file is locked

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (HARMONY-2476) [classlib][nio]FileChannel.read(ByteBuffer) does not throw IOException if underlying file is locked.

Posted by "Richard Liang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-2476?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Richard Liang resolved HARMONY-2476.
------------------------------------

    Resolution: Fixed

Hello Tony,

The patch has been applied at revision r518905. Thanks a lot for this enhancement.

Nikolay, would you please verify this issue is fixed? Thanks a lot.

Best regards,
Richard.

> [classlib][nio]FileChannel.read(ByteBuffer) does not throw IOException if underlying file is locked.
> ----------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2476
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2476
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Nikolay Kuznetsov
>         Assigned To: Richard Liang
>         Attachments: harmony-2476-all-in-one-2.diff, harmony-2476-all-in-one.diff, harmony-2476-luni.diff, harmony-2476-nio.diff, harmony-2476-nio_newtestfile_win32.diff, harmony-2476-portlib.diff, harmony-2476-portlib.diff, test.java
>
>
> An attempt to access a file which is locked by FileChannel.lock() according to RI behavior should result in IOException, attached test demonstrates this problem:
> RI output
> java version "1.5.0"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64):
> Start
> java.io.IOException: The process cannot access the file because another process has locked a portion of the file
>         at jrockit.io.FileNativeIO.read(III)I(Native Method)
>         at jrockit.io.NativeIO.read(Ljava.io.FileDescriptor;II)I(Unknown Source)
>         at jrockit.nio.ch.IOUtil.read(Ljava.io.FileDescriptor;IIJLjrockit.io.NativeIO;Ljava.lang.Object;)I(Unknown Source)
>         at jrockit.nio.ch.IOUtil.read(Ljava.io.FileDescriptor;Ljrockit.io.IOMemory;IJLjrockit.io.NativeIO;Ljava.lang.Object;)I(Unknown Source)
>         at jrockit.nio.ch.IOUtil.read(Ljava.io.FileDescriptor;Ljava.nio.ByteBuffer;JLjrockit.io.NativeIO;Ljava.lang.Object;)I(Unknown Source)
>         at jrockit.nio.ch.FileChannelImpl.read(Ljava.nio.ByteBuffer;)I(Unknown Source)
>         at test.testLockAndTryLock(test.java:47)
>         at test.main(test.java:9)
> PASS
> HARMONY output:
> Start
> Must throw IOException, because file is locked

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.