harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Dmitriev (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-3915) [classlib][nio] java.nio.channels.Selector.select(long timeout) throws SocketException on SIGUSR2
Date Sat, 23 Jun 2007 13:44:26 GMT

    [ https://issues.apache.org/jira/browse/HARMONY-3915?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12507610
] 

Sergey Dmitriev commented on HARMONY-3915:
------------------------------------------

Here is another test (select2.java, attached) which demonstrates the issue.

] boy@moon ~
] ~/jre/bin/java -showversion select2
Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors,
as applicable.
java version "1.5.0"
pre-alpha : not complete or compatible
svn = r549111, (Jun 22 2007), Linux/ia32/gcc 3.3.3, release build
http://harmony.apache.org
WHETHER SELECT(10000) EXITS IF AMY THREAD DIES?
SOME THREAD IS DYING...
Uncaught exception in main:
java.net.SocketException
        at org.apache.harmony.luni.platform.OSNetworkSystem.select(OSNetworkSystem.java:312)
        at org.apache.harmony.nio.internal.SelectorImpl.selectInternal(SelectorImpl.java:190)
        at org.apache.harmony.nio.internal.SelectorImpl.select(SelectorImpl.java:167)
        at select2.main(select2.java:12)


> [classlib][nio] java.nio.channels.Selector.select(long timeout) throws SocketException
on SIGUSR2
> -------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3915
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3915
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: linux
>            Reporter: Sergey Dmitriev
>            Assignee: Mark Hindess
>         Attachments: 3915.patch, 3915_test_2.patch, select.java, select2.java
>
>
> After fixing JIRA#3888 suddenly SelectorTest.test_wakeup() started to
> fail. So fixed 3888 has discovered another issue with selector.
> As it turned out java.nio.channels.Selector.select([long timeout])
> wakes up and throws SocketException when some thread dies. Actually it
> is all connected with the underlying linux function
>     int  select(int  n,  fd_set  *readfds,  fd_set  *writefds,
>                 fd_set *exceptfds, struct timeval *timeout)
> and SIGUSR2 which is used in DRLVM threading subsystem (any other
> threading event which sends SIGUSR2 can cause the problem with
> select()).
> AFAIK some time ago we had the same problem with SIGUSR2 and this
> issue has been easily resolved with SA_RESTART. Unfortunately in case
> of select() it is not applicable since SA_RESTART functionality in
> select() is "implementation-dependent". Quote:
>        int select(int nfds, fd_set *readfds, fd_set *writefds,
>                   fd_set *errorfds, struct timeval *timeout);
>        ...
>        ERRORS
>            Under the following conditions, select() fails and sets
>            errno to:
>        ...
>            [EINTR]
>                The select() function was interrupted before any of the
>                selected events occurred and before the timeout
>                interval expired. If SA_RESTART has been set for the
>                interrupting signal, it is implementation-dependent
>                whether select() restarts or returns with [EINTR].
>       
>        http://www.opengroup.org/onlinepubs/007908799/xsh/select.html
> As it turned out "SUSE LINUX Enterprise Server 9" on my box does not
> support SA_RESTART functionality. So I handled it with cycle. And
> therefore some timeout mathematics comes into play here as well.
> So I believe the code-fix and test-fix for this JIRA and code-fix for
> JIRA #3888 should be committed together since all this stuff intertwined.

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


Mime
View raw message