Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 70924 invoked from network); 17 May 2007 09:48:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 May 2007 09:48:37 -0000 Received: (qmail 90150 invoked by uid 500); 17 May 2007 09:48:43 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 90138 invoked by uid 500); 17 May 2007 09:48:43 -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 90128 invoked by uid 99); 17 May 2007 09:48:43 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 May 2007 02:48:43 -0700 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; Thu, 17 May 2007 02:48:36 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 94E7771406A for ; Thu, 17 May 2007 02:48:16 -0700 (PDT) Message-ID: <4166351.1179395296607.JavaMail.jira@brutus> Date: Thu, 17 May 2007 02:48:16 -0700 (PDT) From: "Mikhail Markov (JIRA)" To: commits@harmony.apache.org Subject: [jira] Updated: (HARMONY-3703) [classlib][archive][netbeans] GZIPInputStream throws IOException when feeding from the network In-Reply-To: <32691400.1176928815403.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-3703?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Mikhail Markov updated HARMONY-3703: ------------------------------------ Attachment: H-3703_add.patch Here is an additional patch fixing the mentioned problem + unit test. There was a problem with previous one as it incorrectly works when the number of remaining bytes in the Inflater was more that 8 (in this case 2-nd parameter in arrycopy() call was incorrect as size was modified and thus (len -size) points to the wrong position). > [classlib][archive][netbeans] GZIPInputStream throws IOException when feeding from the network > ---------------------------------------------------------------------------------------------- > > Key: HARMONY-3703 > URL: https://issues.apache.org/jira/browse/HARMONY-3703 > Project: Harmony > Issue Type: Bug > Components: App-Oriented Bug Reports, Classlib > Reporter: Vasily Zakharov > Assigned To: Alexei Zakharov > Attachments: H-3703.patch, H-3703_add.patch > > > When java.util.zip.GZIPInputStream is passed a stream constructed from a network URL, it throws IOException (Crc mismatch) at end-of-stream. If the same content is fed through local file URL, the problem doesn't occur. It looks like some end-of-stream detection problem is in place, or a race condition. > public class Test { > public static void main(String args[]) throws Exception { > byte[] buffer = new byte[0x100000]; > String url = > "http://www.netbeans.org/updates/55_1.20_.xml.gz"; > //"file:55_1.20_.xml.gz"; > java.io.InputStream stream = new java.util.zip.GZIPInputStream(new java.net.URL(url).openStream()); > int length = 0, num = 0; > while (num >= 0) { > length += num; > System.out.println(length); > num = stream.read(buffer, length, (buffer.length - length)); > } > } > } > $ Ri/bin/java -Dhttp.proxyHost=$PROXY_HOST -Dhttp.proxyPort=$PROXY_PORT Test > 0 > 777 > 3392 > ... > 386431 > SUCCESS > $ HY/bin/java -Dhttp.proxyHost=$PROXY_HOST -Dhttp.proxyPort=$PROXY_PORT Test > 0 > 777 > 3392 > ... > 386431 > Exception in thread "main" java.io.IOException: Crc mismatch > at java.util.zip.GZIPInputStream.read(GZIPInputStream.java:166) > at Test.main(Test.java:13) > On IBM VM, this result is stable. On DRLVM, the test sometimes (rarely) passes, and sometimes (also rarely) another exception occurs instead of IOException: > Uncaught exception in main: > java.lang.ArrayIndexOutOfBoundsException: bad arrayCopy > at java.lang.VMMemoryManager.arrayCopy(VMMemoryManager.java) > at java.lang.System.arraycopy(System.java:86) > at java.util.zip.GZIPInputStream.read(GZIPInputStream.java:161) > at Test.main(Test.java:13) > If content is previously downloaded (wget http://www.netbeans.org/updates/55_1.20_.xml.gz) and local file URL is used instead of network URL (comment line 5, uncomment line 6), output on Harmony becomes identical to output on RI. > This problem was discovered while trying to run NetBeans on Harmony. > Issue HARMONY-3702 was also filed while investigating this one. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.