You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Ivaschenko, Aleksei V (JIRA)" <ji...@apache.org> on 2007/04/12 08:55:32 UTC

[jira] Created: (HARMONY-3631) [classlib][luni] Write operation to non-blocking SocketChannel with overfull output buffer causes unexpected exception

[classlib][luni] Write operation to non-blocking SocketChannel with overfull output buffer causes unexpected exception
----------------------------------------------------------------------------------------------------------------------

                 Key: HARMONY-3631
                 URL: https://issues.apache.org/jira/browse/HARMONY-3631
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
         Environment: Windows and Linux
            Reporter: Ivaschenko, Aleksei V


The attached test creatres non-blocking SocketChannel connection and writes into channel untinl socket output buffer become overfull and further write operations will not write even one byte. This is normal situation according to SocketChannel spec and no exceptions should be thrown. But the test fails on Harmony with exception:

java.lang.NoSuchMethodError: init
        at org.apache.harmony.luni.platform.OSNetworkSystem.writeSocketDirectImpl(Native Method)
        at org.apache.harmony.luni.platform.OSNetworkSystem.writeDirect(OSNetworkSystem.java:105)
        at org.apache.harmony.nio.internal.SocketChannelImpl.writeImpl(SocketChannelImpl.java:557)
        at org.apache.harmony.nio.internal.SocketChannelImpl.write(SocketChannelImpl.java:491)
        ...

This exception is generated by JNI call to GetMethodID while attempt to find java.net.SocketException constructor by name "init" instead of "<init>".
This part of the issue could be fixed with attached patch. Even when this is fixed, the test continue to fail with unexpected exception (but with another one):

java.net.SocketException: The socket is marked as nonblocking operation would block
        at org.apache.harmony.luni.platform.OSNetworkSystem.writeSocketDirectImpl(Native Method)
        at org.apache.harmony.luni.platform.OSNetworkSystem.writeDirect(OSNetworkSystem.java:105)
        at org.apache.harmony.nio.internal.SocketChannelImpl.writeImpl(SocketChannelImpl.java:557)
        at org.apache.harmony.nio.internal.SocketChannelImpl.write(SocketChannelImpl.java:491)
        ...

It's a reasonable exception for non-blocking connections, but according to spec it shouldn't be thrown - write method of SocketChannel should return 0 instead.

This issue also leads Jetty scenario (HARMONY-3530) to fail.


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


[jira] Commented: (HARMONY-3631) [classlib][luni][nio] Write operation to non-blocking SocketChannel with overfull output buffer causes unexpected exception

Posted by "Ivaschenko, Aleksei V (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-3631?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12488637 ] 

Ivaschenko, Aleksei V commented on HARMONY-3631:
------------------------------------------------

Jimmy,

I've rebuilt classlib and DRLVM completely with my patch and the test passes on it. I didn't get why the SocketException was thrown on previous build, perhaps I did something wrong (I soppose the porblem was in my local workspace). Looks like this patch is enough for fixing the bug (Jetty scenario passes too). Thanks for investigation!

Paulex,

Did you mean include as a regression test into DRLVM? If so, you can find it in attached archive.
Thanks for committing the patch! The fix works fine for me.


> [classlib][luni][nio] Write operation to non-blocking SocketChannel with overfull output buffer causes unexpected exception
> ---------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3631
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3631
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: Windows and Linux
>            Reporter: Ivaschenko, Aleksei V
>         Assigned To: Paulex Yang
>         Attachments: h3631.zip, luni.patch, NIOTest.java
>
>
> The attached test creatres non-blocking SocketChannel connection and writes into channel untinl socket output buffer become overfull and further write operations will not write even one byte. This is normal situation according to SocketChannel spec and no exceptions should be thrown. But the test fails on Harmony with exception:
> java.lang.NoSuchMethodError: init
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeSocketDirectImpl(Native Method)
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeDirect(OSNetworkSystem.java:105)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.writeImpl(SocketChannelImpl.java:557)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.write(SocketChannelImpl.java:491)
>         ...
> This exception is generated by JNI call to GetMethodID while attempt to find java.net.SocketException constructor by name "init" instead of "<init>".
> This part of the issue could be fixed with attached patch. Even when this is fixed, the test continue to fail with unexpected exception (but with another one):
> java.net.SocketException: The socket is marked as nonblocking operation would block
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeSocketDirectImpl(Native Method)
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeDirect(OSNetworkSystem.java:105)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.writeImpl(SocketChannelImpl.java:557)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.write(SocketChannelImpl.java:491)
>         ...
> It's a reasonable exception for non-blocking connections, but according to spec it shouldn't be thrown - write method of SocketChannel should return 0 instead.
> This issue also leads Jetty scenario (HARMONY-3530) to fail.

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


[jira] Commented: (HARMONY-3631) [classlib][luni][nio] Write operation to non-blocking SocketChannel with overfull output buffer causes unexpected exception

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

Paulex Yang commented on HARMONY-3631:
--------------------------------------

Ivaschenko, the patch looks good, but possible to include the testcase as a regression? Thank you very much.

> [classlib][luni][nio] Write operation to non-blocking SocketChannel with overfull output buffer causes unexpected exception
> ---------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3631
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3631
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: Windows and Linux
>            Reporter: Ivaschenko, Aleksei V
>         Assigned To: Paulex Yang
>         Attachments: luni.patch, NIOTest.java
>
>
> The attached test creatres non-blocking SocketChannel connection and writes into channel untinl socket output buffer become overfull and further write operations will not write even one byte. This is normal situation according to SocketChannel spec and no exceptions should be thrown. But the test fails on Harmony with exception:
> java.lang.NoSuchMethodError: init
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeSocketDirectImpl(Native Method)
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeDirect(OSNetworkSystem.java:105)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.writeImpl(SocketChannelImpl.java:557)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.write(SocketChannelImpl.java:491)
>         ...
> This exception is generated by JNI call to GetMethodID while attempt to find java.net.SocketException constructor by name "init" instead of "<init>".
> This part of the issue could be fixed with attached patch. Even when this is fixed, the test continue to fail with unexpected exception (but with another one):
> java.net.SocketException: The socket is marked as nonblocking operation would block
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeSocketDirectImpl(Native Method)
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeDirect(OSNetworkSystem.java:105)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.writeImpl(SocketChannelImpl.java:557)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.write(SocketChannelImpl.java:491)
>         ...
> It's a reasonable exception for non-blocking connections, but according to spec it shouldn't be thrown - write method of SocketChannel should return 0 instead.
> This issue also leads Jetty scenario (HARMONY-3530) to fail.

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


[jira] Commented: (HARMONY-3631) [classlib][luni][nio] Write operation to non-blocking SocketChannel with overfull output buffer causes unexpected exception

Posted by "Jimmy, Jing Lv (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-3631?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12488604 ] 

Jimmy, Jing Lv commented on HARMONY-3631:
-----------------------------------------

Hi,
    I looked into the SocketChannelImpl.writeImpl(), but find the code has already handle the problem:
"   ...
            } catch (SocketException e) {
                if (e.getCause() instanceof ErrorCodeException) {
                    if (ERRCODE_SOCKET_NONBLOCKING_WOULD_BLOCK == ((ErrorCodeException) e
                            .getCause()).getErrorCode()) {
                        return writeCount;    // <--NOTE: This line catch the blocking exception for nonblocking 
                    }
                }
                throw e;
            }
..."
     So I feel surprised the exception was still thrown (on DRLVM, I guess?) Is the error code of such issue
changed in Port-Lib?

> [classlib][luni][nio] Write operation to non-blocking SocketChannel with overfull output buffer causes unexpected exception
> ---------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3631
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3631
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: Windows and Linux
>            Reporter: Ivaschenko, Aleksei V
>         Assigned To: Paulex Yang
>         Attachments: luni.patch, NIOTest.java
>
>
> The attached test creatres non-blocking SocketChannel connection and writes into channel untinl socket output buffer become overfull and further write operations will not write even one byte. This is normal situation according to SocketChannel spec and no exceptions should be thrown. But the test fails on Harmony with exception:
> java.lang.NoSuchMethodError: init
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeSocketDirectImpl(Native Method)
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeDirect(OSNetworkSystem.java:105)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.writeImpl(SocketChannelImpl.java:557)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.write(SocketChannelImpl.java:491)
>         ...
> This exception is generated by JNI call to GetMethodID while attempt to find java.net.SocketException constructor by name "init" instead of "<init>".
> This part of the issue could be fixed with attached patch. Even when this is fixed, the test continue to fail with unexpected exception (but with another one):
> java.net.SocketException: The socket is marked as nonblocking operation would block
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeSocketDirectImpl(Native Method)
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeDirect(OSNetworkSystem.java:105)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.writeImpl(SocketChannelImpl.java:557)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.write(SocketChannelImpl.java:491)
>         ...
> It's a reasonable exception for non-blocking connections, but according to spec it shouldn't be thrown - write method of SocketChannel should return 0 instead.
> This issue also leads Jetty scenario (HARMONY-3530) to fail.

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


[jira] Updated: (HARMONY-3631) [classlib][luni][nio] Write operation to non-blocking SocketChannel with overfull output buffer causes unexpected exception

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

Ivaschenko, Aleksei V updated HARMONY-3631:
-------------------------------------------

    Attachment:     (was: h3631.zip)

> [classlib][luni][nio] Write operation to non-blocking SocketChannel with overfull output buffer causes unexpected exception
> ---------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3631
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3631
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: Windows and Linux
>            Reporter: Ivaschenko, Aleksei V
>         Assigned To: Paulex Yang
>         Attachments: luni.patch, NIOTest.java
>
>
> The attached test creatres non-blocking SocketChannel connection and writes into channel untinl socket output buffer become overfull and further write operations will not write even one byte. This is normal situation according to SocketChannel spec and no exceptions should be thrown. But the test fails on Harmony with exception:
> java.lang.NoSuchMethodError: init
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeSocketDirectImpl(Native Method)
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeDirect(OSNetworkSystem.java:105)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.writeImpl(SocketChannelImpl.java:557)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.write(SocketChannelImpl.java:491)
>         ...
> This exception is generated by JNI call to GetMethodID while attempt to find java.net.SocketException constructor by name "init" instead of "<init>".
> This part of the issue could be fixed with attached patch. Even when this is fixed, the test continue to fail with unexpected exception (but with another one):
> java.net.SocketException: The socket is marked as nonblocking operation would block
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeSocketDirectImpl(Native Method)
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeDirect(OSNetworkSystem.java:105)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.writeImpl(SocketChannelImpl.java:557)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.write(SocketChannelImpl.java:491)
>         ...
> It's a reasonable exception for non-blocking connections, but according to spec it shouldn't be thrown - write method of SocketChannel should return 0 instead.
> This issue also leads Jetty scenario (HARMONY-3530) to fail.

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


[jira] Closed: (HARMONY-3631) [classlib][luni][nio] Write operation to non-blocking SocketChannel with overfull output buffer causes unexpected exception

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

Paulex Yang closed HARMONY-3631.
--------------------------------

    Resolution: Cannot Reproduce

Cannot reproduce in latest builds.

> [classlib][luni][nio] Write operation to non-blocking SocketChannel with overfull output buffer causes unexpected exception
> ---------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3631
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3631
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: Windows and Linux
>            Reporter: Ivaschenko, Aleksei V
>         Assigned To: Paulex Yang
>         Attachments: h3631.zip, luni.patch, NIOTest.java
>
>
> The attached test creatres non-blocking SocketChannel connection and writes into channel untinl socket output buffer become overfull and further write operations will not write even one byte. This is normal situation according to SocketChannel spec and no exceptions should be thrown. But the test fails on Harmony with exception:
> java.lang.NoSuchMethodError: init
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeSocketDirectImpl(Native Method)
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeDirect(OSNetworkSystem.java:105)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.writeImpl(SocketChannelImpl.java:557)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.write(SocketChannelImpl.java:491)
>         ...
> This exception is generated by JNI call to GetMethodID while attempt to find java.net.SocketException constructor by name "init" instead of "<init>".
> This part of the issue could be fixed with attached patch. Even when this is fixed, the test continue to fail with unexpected exception (but with another one):
> java.net.SocketException: The socket is marked as nonblocking operation would block
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeSocketDirectImpl(Native Method)
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeDirect(OSNetworkSystem.java:105)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.writeImpl(SocketChannelImpl.java:557)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.write(SocketChannelImpl.java:491)
>         ...
> It's a reasonable exception for non-blocking connections, but according to spec it shouldn't be thrown - write method of SocketChannel should return 0 instead.
> This issue also leads Jetty scenario (HARMONY-3530) to fail.

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


[jira] Updated: (HARMONY-3631) [classlib][luni][nio] Write operation to non-blocking SocketChannel with overfull output buffer causes unexpected exception

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

Ivaschenko, Aleksei V updated HARMONY-3631:
-------------------------------------------

    Attachment: h3631.zip

> [classlib][luni][nio] Write operation to non-blocking SocketChannel with overfull output buffer causes unexpected exception
> ---------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3631
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3631
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: Windows and Linux
>            Reporter: Ivaschenko, Aleksei V
>         Assigned To: Paulex Yang
>         Attachments: h3631.zip, luni.patch, NIOTest.java
>
>
> The attached test creatres non-blocking SocketChannel connection and writes into channel untinl socket output buffer become overfull and further write operations will not write even one byte. This is normal situation according to SocketChannel spec and no exceptions should be thrown. But the test fails on Harmony with exception:
> java.lang.NoSuchMethodError: init
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeSocketDirectImpl(Native Method)
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeDirect(OSNetworkSystem.java:105)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.writeImpl(SocketChannelImpl.java:557)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.write(SocketChannelImpl.java:491)
>         ...
> This exception is generated by JNI call to GetMethodID while attempt to find java.net.SocketException constructor by name "init" instead of "<init>".
> This part of the issue could be fixed with attached patch. Even when this is fixed, the test continue to fail with unexpected exception (but with another one):
> java.net.SocketException: The socket is marked as nonblocking operation would block
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeSocketDirectImpl(Native Method)
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeDirect(OSNetworkSystem.java:105)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.writeImpl(SocketChannelImpl.java:557)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.write(SocketChannelImpl.java:491)
>         ...
> It's a reasonable exception for non-blocking connections, but according to spec it shouldn't be thrown - write method of SocketChannel should return 0 instead.
> This issue also leads Jetty scenario (HARMONY-3530) to fail.

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


[jira] Commented: (HARMONY-3631) [classlib][luni][nio] Write operation to non-blocking SocketChannel with overfull output buffer causes unexpected exception

Posted by "Jimmy, Jing Lv (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-3631?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12488598 ] 

Jimmy, Jing Lv commented on HARMONY-3631:
-----------------------------------------

Hi,
    I've tried this test (with patch on) on my desktop(Windows XP sp2), on IBMVME, but did not find that error, the output was:
"Client created
Server created
Non-blocking connection established
Server expectedly unable to send all 104857600 bytes to client
Server closed connection with client"
    RI shows the same result.
    But according to the exception that thrown, the send operation was blocked due to some OS-level issues. I guess we can catch that exception, return Zero and send again sometime. 

PS: for windows, MSDN says:
"This error is returned from operations on nonblocking sockets that cannot be completed immediately, for example recv when no data is queued to be read from the socket. It is a nonfatal error, and the operation should be retried later. It is normal for WSAEWOULDBLOCK to be reported as the result from calling connect on a nonblocking SOCK_STREAM socket, since some time must elapse for the connection to be established."

> [classlib][luni][nio] Write operation to non-blocking SocketChannel with overfull output buffer causes unexpected exception
> ---------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3631
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3631
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: Windows and Linux
>            Reporter: Ivaschenko, Aleksei V
>         Assigned To: Paulex Yang
>         Attachments: luni.patch, NIOTest.java
>
>
> The attached test creatres non-blocking SocketChannel connection and writes into channel untinl socket output buffer become overfull and further write operations will not write even one byte. This is normal situation according to SocketChannel spec and no exceptions should be thrown. But the test fails on Harmony with exception:
> java.lang.NoSuchMethodError: init
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeSocketDirectImpl(Native Method)
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeDirect(OSNetworkSystem.java:105)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.writeImpl(SocketChannelImpl.java:557)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.write(SocketChannelImpl.java:491)
>         ...
> This exception is generated by JNI call to GetMethodID while attempt to find java.net.SocketException constructor by name "init" instead of "<init>".
> This part of the issue could be fixed with attached patch. Even when this is fixed, the test continue to fail with unexpected exception (but with another one):
> java.net.SocketException: The socket is marked as nonblocking operation would block
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeSocketDirectImpl(Native Method)
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeDirect(OSNetworkSystem.java:105)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.writeImpl(SocketChannelImpl.java:557)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.write(SocketChannelImpl.java:491)
>         ...
> It's a reasonable exception for non-blocking connections, but according to spec it shouldn't be thrown - write method of SocketChannel should return 0 instead.
> This issue also leads Jetty scenario (HARMONY-3530) to fail.

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


[jira] Updated: (HARMONY-3631) [classlib][luni] Write operation to non-blocking SocketChannel with overfull output buffer causes unexpected exception

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

Ivaschenko, Aleksei V updated HARMONY-3631:
-------------------------------------------

    Attachment: luni.patch
                NIOTest.java

> [classlib][luni] Write operation to non-blocking SocketChannel with overfull output buffer causes unexpected exception
> ----------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3631
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3631
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: Windows and Linux
>            Reporter: Ivaschenko, Aleksei V
>         Attachments: luni.patch, NIOTest.java
>
>
> The attached test creatres non-blocking SocketChannel connection and writes into channel untinl socket output buffer become overfull and further write operations will not write even one byte. This is normal situation according to SocketChannel spec and no exceptions should be thrown. But the test fails on Harmony with exception:
> java.lang.NoSuchMethodError: init
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeSocketDirectImpl(Native Method)
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeDirect(OSNetworkSystem.java:105)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.writeImpl(SocketChannelImpl.java:557)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.write(SocketChannelImpl.java:491)
>         ...
> This exception is generated by JNI call to GetMethodID while attempt to find java.net.SocketException constructor by name "init" instead of "<init>".
> This part of the issue could be fixed with attached patch. Even when this is fixed, the test continue to fail with unexpected exception (but with another one):
> java.net.SocketException: The socket is marked as nonblocking operation would block
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeSocketDirectImpl(Native Method)
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeDirect(OSNetworkSystem.java:105)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.writeImpl(SocketChannelImpl.java:557)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.write(SocketChannelImpl.java:491)
>         ...
> It's a reasonable exception for non-blocking connections, but according to spec it shouldn't be thrown - write method of SocketChannel should return 0 instead.
> This issue also leads Jetty scenario (HARMONY-3530) to fail.

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


[jira] Assigned: (HARMONY-3631) [classlib][luni][nio] Write operation to non-blocking SocketChannel with overfull output buffer causes unexpected exception

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

Paulex Yang reassigned HARMONY-3631:
------------------------------------

    Assignee: Paulex Yang

> [classlib][luni][nio] Write operation to non-blocking SocketChannel with overfull output buffer causes unexpected exception
> ---------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3631
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3631
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: Windows and Linux
>            Reporter: Ivaschenko, Aleksei V
>         Assigned To: Paulex Yang
>         Attachments: luni.patch, NIOTest.java
>
>
> The attached test creatres non-blocking SocketChannel connection and writes into channel untinl socket output buffer become overfull and further write operations will not write even one byte. This is normal situation according to SocketChannel spec and no exceptions should be thrown. But the test fails on Harmony with exception:
> java.lang.NoSuchMethodError: init
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeSocketDirectImpl(Native Method)
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeDirect(OSNetworkSystem.java:105)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.writeImpl(SocketChannelImpl.java:557)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.write(SocketChannelImpl.java:491)
>         ...
> This exception is generated by JNI call to GetMethodID while attempt to find java.net.SocketException constructor by name "init" instead of "<init>".
> This part of the issue could be fixed with attached patch. Even when this is fixed, the test continue to fail with unexpected exception (but with another one):
> java.net.SocketException: The socket is marked as nonblocking operation would block
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeSocketDirectImpl(Native Method)
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeDirect(OSNetworkSystem.java:105)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.writeImpl(SocketChannelImpl.java:557)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.write(SocketChannelImpl.java:491)
>         ...
> It's a reasonable exception for non-blocking connections, but according to spec it shouldn't be thrown - write method of SocketChannel should return 0 instead.
> This issue also leads Jetty scenario (HARMONY-3530) to fail.

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


[jira] Commented: (HARMONY-3631) [classlib][luni][nio] Write operation to non-blocking SocketChannel with overfull output buffer causes unexpected exception

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

Paulex Yang commented on HARMONY-3631:
--------------------------------------

luni.patch applied at r528399, thank Ivaschenko found this and provided fix.

> [classlib][luni][nio] Write operation to non-blocking SocketChannel with overfull output buffer causes unexpected exception
> ---------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3631
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3631
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: Windows and Linux
>            Reporter: Ivaschenko, Aleksei V
>         Assigned To: Paulex Yang
>         Attachments: luni.patch, NIOTest.java
>
>
> The attached test creatres non-blocking SocketChannel connection and writes into channel untinl socket output buffer become overfull and further write operations will not write even one byte. This is normal situation according to SocketChannel spec and no exceptions should be thrown. But the test fails on Harmony with exception:
> java.lang.NoSuchMethodError: init
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeSocketDirectImpl(Native Method)
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeDirect(OSNetworkSystem.java:105)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.writeImpl(SocketChannelImpl.java:557)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.write(SocketChannelImpl.java:491)
>         ...
> This exception is generated by JNI call to GetMethodID while attempt to find java.net.SocketException constructor by name "init" instead of "<init>".
> This part of the issue could be fixed with attached patch. Even when this is fixed, the test continue to fail with unexpected exception (but with another one):
> java.net.SocketException: The socket is marked as nonblocking operation would block
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeSocketDirectImpl(Native Method)
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeDirect(OSNetworkSystem.java:105)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.writeImpl(SocketChannelImpl.java:557)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.write(SocketChannelImpl.java:491)
>         ...
> It's a reasonable exception for non-blocking connections, but according to spec it shouldn't be thrown - write method of SocketChannel should return 0 instead.
> This issue also leads Jetty scenario (HARMONY-3530) to fail.

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


[jira] Updated: (HARMONY-3631) [classlib][luni][nio] Write operation to non-blocking SocketChannel with overfull output buffer causes unexpected exception

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

Ivaschenko, Aleksei V updated HARMONY-3631:
-------------------------------------------

    Summary: [classlib][luni][nio] Write operation to non-blocking SocketChannel with overfull output buffer causes unexpected exception  (was: [classlib][luni] Write operation to non-blocking SocketChannel with overfull output buffer causes unexpected exception)

> [classlib][luni][nio] Write operation to non-blocking SocketChannel with overfull output buffer causes unexpected exception
> ---------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3631
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3631
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: Windows and Linux
>            Reporter: Ivaschenko, Aleksei V
>         Attachments: luni.patch, NIOTest.java
>
>
> The attached test creatres non-blocking SocketChannel connection and writes into channel untinl socket output buffer become overfull and further write operations will not write even one byte. This is normal situation according to SocketChannel spec and no exceptions should be thrown. But the test fails on Harmony with exception:
> java.lang.NoSuchMethodError: init
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeSocketDirectImpl(Native Method)
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeDirect(OSNetworkSystem.java:105)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.writeImpl(SocketChannelImpl.java:557)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.write(SocketChannelImpl.java:491)
>         ...
> This exception is generated by JNI call to GetMethodID while attempt to find java.net.SocketException constructor by name "init" instead of "<init>".
> This part of the issue could be fixed with attached patch. Even when this is fixed, the test continue to fail with unexpected exception (but with another one):
> java.net.SocketException: The socket is marked as nonblocking operation would block
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeSocketDirectImpl(Native Method)
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeDirect(OSNetworkSystem.java:105)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.writeImpl(SocketChannelImpl.java:557)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.write(SocketChannelImpl.java:491)
>         ...
> It's a reasonable exception for non-blocking connections, but according to spec it shouldn't be thrown - write method of SocketChannel should return 0 instead.
> This issue also leads Jetty scenario (HARMONY-3530) to fail.

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


[jira] Commented: (HARMONY-3631) [classlib][luni][nio] Write operation to non-blocking SocketChannel with overfull output buffer causes unexpected exception

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

Paulex Yang commented on HARMONY-3631:
--------------------------------------

Jimmy and Ivaschenko,

though this issue is under discussion, but I think the current luni.patch is a right thing to commit, so I'll commit it at first and leave this jira issue as open. 

> [classlib][luni][nio] Write operation to non-blocking SocketChannel with overfull output buffer causes unexpected exception
> ---------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3631
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3631
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: Windows and Linux
>            Reporter: Ivaschenko, Aleksei V
>         Assigned To: Paulex Yang
>         Attachments: luni.patch, NIOTest.java
>
>
> The attached test creatres non-blocking SocketChannel connection and writes into channel untinl socket output buffer become overfull and further write operations will not write even one byte. This is normal situation according to SocketChannel spec and no exceptions should be thrown. But the test fails on Harmony with exception:
> java.lang.NoSuchMethodError: init
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeSocketDirectImpl(Native Method)
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeDirect(OSNetworkSystem.java:105)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.writeImpl(SocketChannelImpl.java:557)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.write(SocketChannelImpl.java:491)
>         ...
> This exception is generated by JNI call to GetMethodID while attempt to find java.net.SocketException constructor by name "init" instead of "<init>".
> This part of the issue could be fixed with attached patch. Even when this is fixed, the test continue to fail with unexpected exception (but with another one):
> java.net.SocketException: The socket is marked as nonblocking operation would block
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeSocketDirectImpl(Native Method)
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeDirect(OSNetworkSystem.java:105)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.writeImpl(SocketChannelImpl.java:557)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.write(SocketChannelImpl.java:491)
>         ...
> It's a reasonable exception for non-blocking connections, but according to spec it shouldn't be thrown - write method of SocketChannel should return 0 instead.
> This issue also leads Jetty scenario (HARMONY-3530) to fail.

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


[jira] Updated: (HARMONY-3631) [classlib][luni][nio] Write operation to non-blocking SocketChannel with overfull output buffer causes unexpected exception

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

Ivaschenko, Aleksei V updated HARMONY-3631:
-------------------------------------------

    Attachment: h3631.zip

DRLVM regression test attached.

> [classlib][luni][nio] Write operation to non-blocking SocketChannel with overfull output buffer causes unexpected exception
> ---------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3631
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3631
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: Windows and Linux
>            Reporter: Ivaschenko, Aleksei V
>         Assigned To: Paulex Yang
>         Attachments: h3631.zip, luni.patch, NIOTest.java
>
>
> The attached test creatres non-blocking SocketChannel connection and writes into channel untinl socket output buffer become overfull and further write operations will not write even one byte. This is normal situation according to SocketChannel spec and no exceptions should be thrown. But the test fails on Harmony with exception:
> java.lang.NoSuchMethodError: init
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeSocketDirectImpl(Native Method)
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeDirect(OSNetworkSystem.java:105)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.writeImpl(SocketChannelImpl.java:557)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.write(SocketChannelImpl.java:491)
>         ...
> This exception is generated by JNI call to GetMethodID while attempt to find java.net.SocketException constructor by name "init" instead of "<init>".
> This part of the issue could be fixed with attached patch. Even when this is fixed, the test continue to fail with unexpected exception (but with another one):
> java.net.SocketException: The socket is marked as nonblocking operation would block
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeSocketDirectImpl(Native Method)
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeDirect(OSNetworkSystem.java:105)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.writeImpl(SocketChannelImpl.java:557)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.write(SocketChannelImpl.java:491)
>         ...
> It's a reasonable exception for non-blocking connections, but according to spec it shouldn't be thrown - write method of SocketChannel should return 0 instead.
> This issue also leads Jetty scenario (HARMONY-3530) to fail.

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


[jira] Commented: (HARMONY-3631) [classlib][luni][nio] Write operation to non-blocking SocketChannel with overfull output buffer causes unexpected exception

Posted by "Ivaschenko, Aleksei V (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-3631?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12489595 ] 

Ivaschenko, Aleksei V commented on HARMONY-3631:
------------------------------------------------

Paulex,

I've verified fix on latest builds - both the test and Jetty scenario work fine on them. So I think the bug could be closed as fixed.
Thanks.

> [classlib][luni][nio] Write operation to non-blocking SocketChannel with overfull output buffer causes unexpected exception
> ---------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3631
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3631
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: Windows and Linux
>            Reporter: Ivaschenko, Aleksei V
>         Assigned To: Paulex Yang
>         Attachments: h3631.zip, luni.patch, NIOTest.java
>
>
> The attached test creatres non-blocking SocketChannel connection and writes into channel untinl socket output buffer become overfull and further write operations will not write even one byte. This is normal situation according to SocketChannel spec and no exceptions should be thrown. But the test fails on Harmony with exception:
> java.lang.NoSuchMethodError: init
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeSocketDirectImpl(Native Method)
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeDirect(OSNetworkSystem.java:105)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.writeImpl(SocketChannelImpl.java:557)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.write(SocketChannelImpl.java:491)
>         ...
> This exception is generated by JNI call to GetMethodID while attempt to find java.net.SocketException constructor by name "init" instead of "<init>".
> This part of the issue could be fixed with attached patch. Even when this is fixed, the test continue to fail with unexpected exception (but with another one):
> java.net.SocketException: The socket is marked as nonblocking operation would block
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeSocketDirectImpl(Native Method)
>         at org.apache.harmony.luni.platform.OSNetworkSystem.writeDirect(OSNetworkSystem.java:105)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.writeImpl(SocketChannelImpl.java:557)
>         at org.apache.harmony.nio.internal.SocketChannelImpl.write(SocketChannelImpl.java:491)
>         ...
> It's a reasonable exception for non-blocking connections, but according to spec it shouldn't be thrown - write method of SocketChannel should return 0 instead.
> This issue also leads Jetty scenario (HARMONY-3530) to fail.

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