You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Tim Ellison (JIRA)" <ji...@apache.org> on 2008/02/04 13:45:08 UTC

[jira] Commented: (HARMONY-5219) [classlib][nio] Jetty@Harmony corrupts big static files while downloading

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

Tim Ellison commented on HARMONY-5219:
--------------------------------------

I'm going to close this as fixed unless we hear of any further problems.


> [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
>            Assignee: Tim Ellison
>             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.