Return-Path: Delivered-To: apmail-incubator-harmony-commits-archive@www.apache.org Received: (qmail 52838 invoked from network); 15 Mar 2006 18:33:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 15 Mar 2006 18:33:22 -0000 Received: (qmail 19691 invoked by uid 500); 15 Mar 2006 18:33:21 -0000 Delivered-To: apmail-incubator-harmony-commits-archive@incubator.apache.org Received: (qmail 19659 invoked by uid 500); 15 Mar 2006 18:33:21 -0000 Mailing-List: contact harmony-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-commits@incubator.apache.org Received: (qmail 19647 invoked by uid 99); 15 Mar 2006 18:33:21 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Mar 2006 10:33:21 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Mar 2006 10:33:20 -0800 Received: from ajax (localhost.localdomain [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id B725BD49FF for ; Wed, 15 Mar 2006 18:32:59 +0000 (GMT) Message-ID: <285403219.1142447579747.JavaMail.jira@ajax> Date: Wed, 15 Mar 2006 18:32:59 +0000 (GMT) From: "Tim Ellison (JIRA)" To: harmony-commits@incubator.apache.org Subject: [jira] Closed: (HARMONY-89) java.util.jar.Manifest().read(InputStream is) throws OutOfMemoryError MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/HARMONY-89?page=all ] Tim Ellison closed HARMONY-89: ------------------------------ Closing resolved issue -- no response from reporter, so assuming ok. > java.util.jar.Manifest().read(InputStream is) throws OutOfMemoryError > --------------------------------------------------------------------- > > Key: HARMONY-89 > URL: http://issues.apache.org/jira/browse/HARMONY-89 > Project: Harmony > Type: Bug > Components: Classlib > Reporter: Svetlana Samoilenko > Assignee: Tim Ellison > Attachments: fix.txt > > Synopsis: java.util.jar.Manifest().read(InputStream is) throws OutOfMemoryError > Description: For test listed below BEA throws IOException while Harmony throws OutOfMemoryError. > The test creates an instance of InputStreamImpl where read method is implemented in simple way and returned any integer value, in particular in.available()== 0 and in.read(buf) == buf.length. > There is no checking for this conditions in the InitManifest.readLines method and as a result an endless loop occurs. > Suggested fix in attachment may be incomplete, needs additional investigation. > Code to reproduce: > import java.util.jar.*; > import java.io.*; > > public class test2 { > public static void main(String args[]) { > InputStream is = new InputStreamImpl(); > try { > new Manifest().read(is); > } catch (IOException e) { > e.printStackTrace(); > System.out.println("PASSED"); > } > } > } > class InputStreamImpl extends InputStream{ > public InputStreamImpl() { > super(); > } > public int read() { > return 0; > } > } > Steps to Reproduce: > 1. Build Harmony (check-out on 2006-01-30) j2se subset as described in README.txt. > 2. Compile test2.java using BEA 1.4 javac > > javac -d . test2.java > 3. Run java using compatible VM (J9) > > java -showversion test2 > Output: > C:\tmp>C:\jrockit-j2sdk1.4.2_04\bin\java.exe -showversion test2 > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) > BEA WebLogic JRockit(TM) 1.4.2_04 JVM (build ari-31788-20040616-1132-win-ia32, Native Threads, GC strategy: parallel) > java.io.IOException: line too long > at java.util.jar.Attributes.read(Ljava.util.jar.Manifest$FastInputStream;[B)V(Attributes.java:356) > at java.util.jar.Manifest.read(Ljava.io.InputStream;)V(Manifest.java:167) > at test2.main([Ljava.lang.String;)V(test2.java:8) > PASSED > C:\tmp>C:\harmony\trunk\deploy\jre\bin\java -showversion test2 > (c) Copyright 1991, 2005 The Apache Software Foundation or its licensors, as applicable. > java.lang.OutOfMemoryError > at java.util.jar.InitManifest.readLines(InitManifest.java:224) > at java.util.jar.InitManifest.(InitManifest.java:61) > at java.util.jar.Manifest.read(Manifest.java:273) > at test2.main(test2.java:10) > Suggested junit test case: > ------------------------ ManifestTest.java ------------------------------------------------- > import junit.framework.*; > import java.io.*; > import java.util.jar.Manifest; > public class ManifestTest extends TestCase { > public static void main(String[] args) { > junit.textui.TestRunner.run(ManifestTest.class); > } > public void test_read () { > InputStream is = new InputStreamImpl(); > try { > new Manifest().read(is); > } catch (IOException e) { > //expected > } > } > } > class InputStreamImpl extends InputStream > > public InputStreamImpl() { > super(); > } > public int read() { > return 0; > } > } -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira