harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Ellison (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-5219) [classlib][nio] Jetty@Harmony corrupts big static files while downloading
Date Wed, 05 Dec 2007 22:51:43 GMT

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

Tim Ellison commented on HARMONY-5219:

I see some file handles being passed in when closed, as shown in my earlier comment; and a
crash with a file descriptor object itself being null in the read array, e.g.

#10 <signal handler called>
#11 0xb7cd78ca in getLongField ()
   from /home/tellison/Harmony/deploy/jdk/jre/bin/default/libj9vm23.so
#12 0x96db31e9 in getJavaIoFileDescriptorContentsAsAPointer (env=0x847d300, fd=0x0)
    at ../shared/nethelp.c:1326
#13 0x96dcaf5e in Java_org_apache_harmony_luni_platform_OSNetworkSystem_selectImpl (
    env=0x847d300, thisClz=0x80f0030, readFDArray=0x83febfc, writeFDArray=0x83febf8,
    countReadC=2, countWriteC=0, outFlags=0x83febec, timeout=1000) at OSNetworkSystemLinux.c:267

Putting an assertion into the OSNetworkSystem type for select shows that some elements are
null as they are passed into the native.  Seems like there is a problem in the Java code setting
up the arrays.

> [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
> 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
>   6: org/apache/harmony/luni/platform/OSNetworkSystem.select([Ljava/io/FileDescriptor;[Ljava/io/FileDescriptor;J)[I
>   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.

View raw message