Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 71423 invoked from network); 5 Dec 2007 14:55:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Dec 2007 14:55:12 -0000 Received: (qmail 48144 invoked by uid 500); 5 Dec 2007 14:55:00 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 48127 invoked by uid 500); 5 Dec 2007 14:55:00 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 48113 invoked by uid 99); 5 Dec 2007 14:55:00 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Dec 2007 06:55:00 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Dec 2007 14:54:40 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 172C47141FE for ; Wed, 5 Dec 2007 06:54:43 -0800 (PST) Message-ID: <19283438.1196866483070.JavaMail.jira@brutus> Date: Wed, 5 Dec 2007 06:54:43 -0800 (PST) From: "Mark Hindess (JIRA)" To: commits@harmony.apache.org Subject: [jira] Commented: (HARMONY-5219) [classlib][nio] Jetty@Harmony corrupts big static files while downloading In-Reply-To: <5023999.1196332662994.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HARMONY-5219?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12548686 ] Mark Hindess commented on HARMONY-5219: --------------------------------------- Looks like one of the write handles is closed (IIRC hysocketP == -1 when it is closed). Will investigate further. > [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) > > 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.