harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aleksey Shipilev (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-5219) [classlib][nio] Jetty@Harmony corrupts big static files while downloading
Date Thu, 06 Dec 2007 12:31:45 GMT

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

Aleksey Shipilev commented on HARMONY-5219:
-------------------------------------------

The major difference between RHEL and SLES tests (with epoll selectors) are:

==== RHEL (correct) =====
epoll(133): waiting on 2 channels for 60000 msecs
epoll(133): ready keys in queue: 137 
epoll(133): 1 channels up, 2 total
processSelectResult(): selected = 1
epoll(133): * modifying 137 in filedescriptor list with mode 0 and event mask 0
epoll(133): waiting on 2 channels for 60000 msecs
epoll(133): ready keys in queue: 
epoll(133): -1 channels up, 2 total
epoll(133): * deleting 137 from filedescriptor list


==== SLES (incorrect) =====
epoll(129): waiting on 2 channels for 60000 msecs
epoll(133): ready keys in queue: 137 
epoll(133): 1 channels up, 2 total
processSelectResult(): selected = 1
epoll(133): * modifying 137 in filedescriptor list with mode 0 and event mask 0
epoll(133): waiting on 2 channels for 60000 msecs
epoll(133): ready keys in queue: 134 
epoll(133): 1 channels up, 2 total
processSelectResult(): selected = 0
(endless loop)

It seems like on RHEL setting event mask to 0 _drops_ all registered events there, while SLES
does not.

> [classlib][nio] Jetty@Harmony corrupts big static files while downloading
> -------------------------------------------------------------------------
>
>                 Key: HARMONY-5219
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5219
>             Project: Harmony
>          Issue Type: Bug
>          Components: App-Oriented Bug Reports, Classlib
>         Environment: linux32, linux64
>            Reporter: Alexei Zakharov
>            Priority: Critical
>             Fix For: 5.0M4
>
>         Attachments: data.txt.original, TestJettyStatic.java
>
>
> Currently we can see JettyScenario failures in about 30% of cases when it is run by CC
on Linux (both 32 and 64 bit). To be more precise the test "testStaticContent" fails with
unclear message "Content is not correct." - see [1]
> I've created a reproducer for this issue - you may find it attached. The problem itself
can be formulated in the following way: Jetty corrupts long static files while downloading
if it is run on top of Harmony.
> Exact steps to reproduce are following:
> 1.	Download one of the recent Jetty snapshots. For example it can be downloaded from
here [2], this version of Jetty is used by our CC. 
> 2.	Unpack it 
> 3.	Start jetty using DRLVM: $DRLVM_HOME/bin/jar -jar start.jar
> 4.	Download and compile attached "TestJettyStatic.java"
> 5.	Place attached golden file "data.txt.original" into the same folder with TestJettyStatic
class
> 6.	Run TestJettyStatic using RI (or with Harmony - it doesn't really matter)
> After doing this you most likely see:
> 1)	Failure of both tests
> 2)	VM crash of the Jetty server's VM with the following stacktrace (if default NIO selector
provider is used):
> SIGSEGV in VM code.
> Stack trace:
>   0: Java_org_apache_harmony_luni_platform_OSNetworkSystem_selectImpl (??:-1)
> addr2line: '[stack]': No such file
>   1: ?? (ava_org_apache_harmony_luni_platform_OSNetworkSystem_selectImpl:-1)
>   2: ?? (??:-1)
>   3: ?? (??:-1)
>   4: ?? (??:-1)
>   5: org/apache/harmony/luni/platform/OSNetworkSystem.selectImpl([Ljava/io/FileDescriptor;[Ljava/io/FileDescriptor;II[IJ)I
(OSNetworkSystem.java:-2)
>   6: org/apache/harmony/luni/platform/OSNetworkSystem.select([Ljava/io/FileDescriptor;[Ljava/io/FileDescriptor;J)[I
(OSNetworkSystem.java:302)
>   7: org/apache/harmony/nio/internal/SelectorImpl.selectInternal(J)I (SelectorImpl.java:-1)
>   8: org/apache/harmony/nio/internal/SelectorImpl.select(J)I (SelectorImpl.java:437)
>   9: org/mortbay/io/nio/SelectorManager$SelectSet.doSelect()V (SelectorManager.java:-1)
>  10: org/mortbay/io/nio/SelectorManager.doSelect(I)V (SelectorManager.java:169)
>  11: org/mortbay/jetty/nio/SelectChannelConnector.accept(I)V (SelectChannelConne
> ctor.java:-1)
>  12: org/mortbay/jetty/AbstractConnector$Acceptor.run()V (AbstractConnector.java:516)
>  13: org/mortbay/thread/BoundedThreadPool$PoolThread.run()V (BoundedThreadPool.java:442)
>  14: java/lang/Thread.runImpl()V (Thread.java:683)
> <end of stack trace>
> 3)	Hang (dead loop) of Jetty server's VM if alternative epoll-based NIO selector provider
is used by specifying  "-Djava.nio.channels.spi.SelectorProvider=org.apache.harmony.nio.internal.EpollSelectorProviderImpl":
> java.nio.channels.CancelledKeyException
>         at org.apache.harmony.nio.internal.SelectionKeyImpl.checkValid(SelectionKeyImpl.java:90)
>         at org.apache.harmony.nio.internal.SelectionKeyImpl.interestOps(SelectionKeyImpl.java:55)
>         at org.apache.harmony.nio.internal.SelectorImpl.prepareChannels(SelectorImpl.java:228)
>         at org.apache.harmony.nio.internal.SelectorImpl.selectInternal(SelectorImpl.java:187)
>         at org.apache.harmony.nio.internal.SelectorImpl.select(SelectorImpl.java:169)
>         at org.mortbay.io.nio.SelectorManager$SelectSet.doSelect(SelectorManager.java)
>         at org.mortbay.io.nio.SelectorManager.doSelect(SelectorManager.java:175)    
   at org.mortbay.jetty.nio.SelectChannelConnector.accept(SelectChannelConnector.java)
>         at org.mortbay.jetty.AbstractConnector$Acceptor.run(AbstractConnector.java:498)
>         at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:442)
> However, if Jetty is reconfigured to use some other connector that does not use NIO selectors
(for example SocketConnector or BlockingChannelConnector) instead of default SelectChannelConnector
then everything works fine. Jetty configuration can be changes by updating "etc/jetty.xml".
So it looks like the problem is in Harmony implementation of NIO selectors.
> BTW the issue is reproducible on J9 VM as well. On RI everything works fine - no hangs
or crashes, both tests pass. The issue is not a regression - I was able to reproduce it on
M3@linux32 build too. 
> [1] http://people.apache.org/~smishura/r597436/Linux_x86/JettyScenario/
> [2] http://dist.codehaus.org/jetty/jetty-6.1.x/jetty-6.1.2pre1.zip 

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