United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6446657 Infinite recursion inside javac with simple jar file
JDK-6446657 : Infinite recursion inside javac with simple jar file

Details
Type:
Bug
Submit Date:
2006-07-06
Status:
Closed
Updated Date:
2014-02-27
Project Name:
JDK
Resolved Date:
2006-08-01
Component:
tools
OS:
solaris_10
Sub-Component:
javac
CPU:
sparc
Priority:
P3
Resolution:
Duplicate
Affected Versions:
5.0
Fixed Versions:

Related Reports
Duplicate:

Sub Tasks

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.

                                    

Comments



Hardware and Software, Engineered to Work Together