You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Paulex Yang (JIRA)" <ji...@apache.org> on 2006/06/02 04:15:29 UTC

[jira] Created: (HARMONY-549) [classlib][nio-channels]java.nio.channels.SocketChannel.read/write mis-acts in some condition.

[classlib][nio-channels]java.nio.channels.SocketChannel.read/write mis-acts in some condition.
----------------------------------------------------------------------------------------------

         Key: HARMONY-549
         URL: http://issues.apache.org/jira/browse/HARMONY-549
     Project: Harmony
        Type: Bug

  Components: Classlib  
    Reporter: Paulex Yang
    Priority: Minor


1. java.nio.channels.SocketChannel.read(ByteBuffer[],int,int) & read(ByteBuffer[]) hang when reading a ByteBuffer array if one of its elements is null. The bug is caused by incorrect sequence of ByteBuffer-checking. The elements must be checked before reading, currently Harmony reads and won't throw NPE until it meets a null ByteBuffer.

2. java.nio.channels.SocketChannel.write(ByteBuffer[],int,int) should check if any elements of ByteBuffer array is null before writing into socket. Currently Harmony writes and won't throw NPE until it meets a null ByteBuffer.

3. java.nio.channels.SocketChannel.write(ByteBuffer) causes an IllegalArgumentException while writing a bytebuffer whose position is not zero.

4. java.nio.channels.SocketChannel.write(ByteBuffer) should throw NPE ahead of ClosedChannelException. When SocketChannel is closed and writes a null buf, it should throw NPE.

5. java.nio.channels.SocketChannel.read(ByteBuffer[],int,int) fails to return -1 when the socket meets EOF. 

I'll attach test cases and patch for them soon.

-- 
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-549) [classlib][nio-channels]java.nio.channels.SocketChannel.read/write mis-acts in some condition.

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

Paulex Yang updated HARMONY-549:
--------------------------------

    Attachment: Harmony549.diff

Please try this patch, thank you. 

This patch includes the regression test and bug fixing, and also includes some modification on the SocketChannelImpl related to async interrupt, which probablly are bugs, and they don't show themselves just because we haven't got the AbstractInterruptibleChannel fully implemented.

> [classlib][nio-channels]java.nio.channels.SocketChannel.read/write mis-acts in some condition.
> ----------------------------------------------------------------------------------------------
>
>          Key: HARMONY-549
>          URL: http://issues.apache.org/jira/browse/HARMONY-549
>      Project: Harmony
>         Type: Bug

>   Components: Classlib
>     Reporter: Paulex Yang
>     Priority: Minor
>  Attachments: Harmony549.diff
>
> 1. java.nio.channels.SocketChannel.read(ByteBuffer[],int,int) & read(ByteBuffer[]) hang when reading a ByteBuffer array if one of its elements is null. The bug is caused by incorrect sequence of ByteBuffer-checking. The elements must be checked before reading, currently Harmony reads and won't throw NPE until it meets a null ByteBuffer.
> 2. java.nio.channels.SocketChannel.write(ByteBuffer[],int,int) should check if any elements of ByteBuffer array is null before writing into socket. Currently Harmony writes and won't throw NPE until it meets a null ByteBuffer.
> 3. java.nio.channels.SocketChannel.write(ByteBuffer) causes an IllegalArgumentException while writing a bytebuffer whose position is not zero.
> 4. java.nio.channels.SocketChannel.write(ByteBuffer) should throw NPE ahead of ClosedChannelException. When SocketChannel is closed and writes a null buf, it should throw NPE.
> 5. java.nio.channels.SocketChannel.read(ByteBuffer[],int,int) fails to return -1 when the socket meets EOF. 
> I'll attach test cases and patch for them soon.

-- 
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] Closed: (HARMONY-549) [classlib][nio-channels]java.nio.channels.SocketChannel.read/write mis-acts in some condition.

Posted by "Mikhail Loenko (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-549?page=all ]
     
Mikhail Loenko closed HARMONY-549:
----------------------------------


verified by Paulex

> [classlib][nio-channels]java.nio.channels.SocketChannel.read/write mis-acts in some condition.
> ----------------------------------------------------------------------------------------------
>
>          Key: HARMONY-549
>          URL: http://issues.apache.org/jira/browse/HARMONY-549
>      Project: Harmony
>         Type: Bug

>   Components: Classlib
>     Reporter: Paulex Yang
>     Assignee: Mikhail Loenko
>     Priority: Minor
>  Attachments: Harmony549.diff
>
> 1. java.nio.channels.SocketChannel.read(ByteBuffer[],int,int) & read(ByteBuffer[]) hang when reading a ByteBuffer array if one of its elements is null. The bug is caused by incorrect sequence of ByteBuffer-checking. The elements must be checked before reading, currently Harmony reads and won't throw NPE until it meets a null ByteBuffer.
> 2. java.nio.channels.SocketChannel.write(ByteBuffer[],int,int) should check if any elements of ByteBuffer array is null before writing into socket. Currently Harmony writes and won't throw NPE until it meets a null ByteBuffer.
> 3. java.nio.channels.SocketChannel.write(ByteBuffer) causes an IllegalArgumentException while writing a bytebuffer whose position is not zero.
> 4. java.nio.channels.SocketChannel.write(ByteBuffer) should throw NPE ahead of ClosedChannelException. When SocketChannel is closed and writes a null buf, it should throw NPE.
> 5. java.nio.channels.SocketChannel.read(ByteBuffer[],int,int) fails to return -1 when the socket meets EOF. 
> I'll attach test cases and patch for them soon.

-- 
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-549) [classlib][nio-channels]java.nio.channels.SocketChannel.read/write mis-acts in some condition.

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

Mikhail Loenko reassigned HARMONY-549:
--------------------------------------

    Assign To: Mikhail Loenko

> [classlib][nio-channels]java.nio.channels.SocketChannel.read/write mis-acts in some condition.
> ----------------------------------------------------------------------------------------------
>
>          Key: HARMONY-549
>          URL: http://issues.apache.org/jira/browse/HARMONY-549
>      Project: Harmony
>         Type: Bug

>   Components: Classlib
>     Reporter: Paulex Yang
>     Assignee: Mikhail Loenko
>     Priority: Minor
>  Attachments: Harmony549.diff
>
> 1. java.nio.channels.SocketChannel.read(ByteBuffer[],int,int) & read(ByteBuffer[]) hang when reading a ByteBuffer array if one of its elements is null. The bug is caused by incorrect sequence of ByteBuffer-checking. The elements must be checked before reading, currently Harmony reads and won't throw NPE until it meets a null ByteBuffer.
> 2. java.nio.channels.SocketChannel.write(ByteBuffer[],int,int) should check if any elements of ByteBuffer array is null before writing into socket. Currently Harmony writes and won't throw NPE until it meets a null ByteBuffer.
> 3. java.nio.channels.SocketChannel.write(ByteBuffer) causes an IllegalArgumentException while writing a bytebuffer whose position is not zero.
> 4. java.nio.channels.SocketChannel.write(ByteBuffer) should throw NPE ahead of ClosedChannelException. When SocketChannel is closed and writes a null buf, it should throw NPE.
> 5. java.nio.channels.SocketChannel.read(ByteBuffer[],int,int) fails to return -1 when the socket meets EOF. 
> I'll attach test cases and patch for them soon.

-- 
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] Commented: (HARMONY-549) [classlib][nio-channels]java.nio.channels.SocketChannel.read/write mis-acts in some condition.

Posted by "Paulex Yang (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-549?page=comments#action_12414747 ] 

Paulex Yang commented on HARMONY-549:
-------------------------------------

looks fine, thank you, Mikhail.

> [classlib][nio-channels]java.nio.channels.SocketChannel.read/write mis-acts in some condition.
> ----------------------------------------------------------------------------------------------
>
>          Key: HARMONY-549
>          URL: http://issues.apache.org/jira/browse/HARMONY-549
>      Project: Harmony
>         Type: Bug

>   Components: Classlib
>     Reporter: Paulex Yang
>     Assignee: Mikhail Loenko
>     Priority: Minor
>  Attachments: Harmony549.diff
>
> 1. java.nio.channels.SocketChannel.read(ByteBuffer[],int,int) & read(ByteBuffer[]) hang when reading a ByteBuffer array if one of its elements is null. The bug is caused by incorrect sequence of ByteBuffer-checking. The elements must be checked before reading, currently Harmony reads and won't throw NPE until it meets a null ByteBuffer.
> 2. java.nio.channels.SocketChannel.write(ByteBuffer[],int,int) should check if any elements of ByteBuffer array is null before writing into socket. Currently Harmony writes and won't throw NPE until it meets a null ByteBuffer.
> 3. java.nio.channels.SocketChannel.write(ByteBuffer) causes an IllegalArgumentException while writing a bytebuffer whose position is not zero.
> 4. java.nio.channels.SocketChannel.write(ByteBuffer) should throw NPE ahead of ClosedChannelException. When SocketChannel is closed and writes a null buf, it should throw NPE.
> 5. java.nio.channels.SocketChannel.read(ByteBuffer[],int,int) fails to return -1 when the socket meets EOF. 
> I'll attach test cases and patch for them soon.

-- 
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] Resolved: (HARMONY-549) [classlib][nio-channels]java.nio.channels.SocketChannel.read/write mis-acts in some condition.

Posted by "Mikhail Loenko (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-549?page=all ]
     
Mikhail Loenko resolved HARMONY-549:
------------------------------------

    Resolution: Fixed

fixed in revision 411114
Paulex please check that it fully resolves the issue

> [classlib][nio-channels]java.nio.channels.SocketChannel.read/write mis-acts in some condition.
> ----------------------------------------------------------------------------------------------
>
>          Key: HARMONY-549
>          URL: http://issues.apache.org/jira/browse/HARMONY-549
>      Project: Harmony
>         Type: Bug

>   Components: Classlib
>     Reporter: Paulex Yang
>     Assignee: Mikhail Loenko
>     Priority: Minor
>  Attachments: Harmony549.diff
>
> 1. java.nio.channels.SocketChannel.read(ByteBuffer[],int,int) & read(ByteBuffer[]) hang when reading a ByteBuffer array if one of its elements is null. The bug is caused by incorrect sequence of ByteBuffer-checking. The elements must be checked before reading, currently Harmony reads and won't throw NPE until it meets a null ByteBuffer.
> 2. java.nio.channels.SocketChannel.write(ByteBuffer[],int,int) should check if any elements of ByteBuffer array is null before writing into socket. Currently Harmony writes and won't throw NPE until it meets a null ByteBuffer.
> 3. java.nio.channels.SocketChannel.write(ByteBuffer) causes an IllegalArgumentException while writing a bytebuffer whose position is not zero.
> 4. java.nio.channels.SocketChannel.write(ByteBuffer) should throw NPE ahead of ClosedChannelException. When SocketChannel is closed and writes a null buf, it should throw NPE.
> 5. java.nio.channels.SocketChannel.read(ByteBuffer[],int,int) fails to return -1 when the socket meets EOF. 
> I'll attach test cases and patch for them soon.

-- 
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