Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 6446657
Votes 0
Synopsis Infinite recursion inside javac with simple jar file
Category java:compiler
Reported Against
Release Fixed
State 11-Closed, duplicate of 6400872, bug
Priority: 3-Medium
Related Bugs
Submit Date 06-JUL-2006
Description
FULL PRODUCT VERSION :
java version "1.5.0_07"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_07-b03)
Java HotSpot(TM) Server VM (build 1.5.0_07-b03, mixed mode)

ADDITIONAL OS VERSION INFORMATION :
Solaris 10, or Linux, or Windows

A DESCRIPTION OF THE PROBLEM :
When using javac with a classpath for a jar file that contains a Class-Path entry in its manifest that uses a relative path, javac can end up in an infinite loop creating Strings until it runs out of memory.

The problem appears to be with the way that javac decides whether it has previously encountered a jar file. It doesn't consider relative paths as being the same: for example

../Foo/Foo.jar

is the same jar file as

../Foo/../Foo/Foo.jar

but javac treats them as different. This can cause all sorts of errors including OutOfMemory (which we've seen with real code) and a zip error in the example given below.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Create a directory e.g $HOME/Foo
2. Create a file MyManifest.txt that contains just this text : Class-Path: ../Foo/Foo.jar
3. Create an empty jar file : jar cvf Foo.jar .
4. Add the manifest : jar cfm Foo.jar MyManifest.txt
5. Put a trivial java source file into the directory and compile it as javac -classpath Foo.jar Test.java

Note the error message.

REPRODUCIBILITY :
This bug can be reproduced always.
Posted Date : 2006-07-06 12:25:03.0
Work Around
N/A
Evaluation
N/A
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang