-
Bug
-
Resolution: Fixed
-
P2
-
1.2.0
-
1.2beta3
-
sparc
-
solaris_2.5
-
Not verified
Name: szC45993 Date: 02/04/98
The jvm spec (2.16.2 Loading, p. 43) says:
"If an error occurs during class loading, then an instance of one of the following subclasses of class LinkageError will be thrown at any point in the Java program that (directly or indirectly) uses the type:
- ClassCircularityError: A class or interface could not be loaded because it would be its own superclass or superinterface ($2.13.2)."
It seems that it would be true for circularity in the few superclasses
chain but such case is not described in the vm spec.
Example below based on JCK execution01902 test case crashes JDK JDK-1.2beta3-C,D,E
Note that JDK-1.2beta3-B works fine.
Note also that similar Bug Id: 4011014 (Synopsis: Segmentation fault instead
of ClassCircularityError on loading) was fixed year ago.
See sources, script and results below:
----------------------clss.java------------------
class cls2 {}
class cls1 extends cls2 {
public static void main(String argv[]) {}
}
----------------------clss2.java------------------
class cls1 {}
class cls2 extends cls1 {
public static void main(String argv[]) {}
}
----------------------- run.sh -------------------
#set -x
LANG=C; export LANG
JAVA_HOME=/export/ld14/java/dest/jdk1.2/solaris/bin
mkdir -p dir1
mkdir -p dir2
rm *.class
$JAVA_HOME/javac -d dir1 clss.java
$JAVA_HOME/javac -d dir2 clss2.java
CLASSPATH=. ; export CLASSPATH
cp dir1/cls1.class .
cp dir2/cls2.class .
for b in jdk1.1.1 jdk1.1.2 jdk1.1.3 jdk1.1.4 jdk1.1.4G jdk1.1.5 jdk1.1.6 jdk1.2 jdk1.2P jdk1.2W jdk1.2Z jdk1.2b3A jdk1.2b3B jdk1.2b3C jdk1.2b3D jdk1.2b3E
do
/export/ld14/java/dest/$b/solaris/bin/java -fullversion
/export/ld14/java/dest/$b/solaris/bin/java -verify cls1
done
----------------------- run.sh -------------------
./run.sh
java full version "JDK1.1.1E"
Can't find class cls1
java full version "JDK1.1.2G"
Can't find class cls1
java full version "JDK1.1.3F"
Can't find class cls1
java full version "JDK1.1.4J"
Can't find class cls1
java full version "JDK1.1.4G"
Can't find class cls1
java full version "JDK1.1.5K"
Can't find class cls1
java full version "JDK1.1.6B"
Can't find class cls1
java full version "JDK-1.2beta3-A"
java.lang.ClassCircularityError: cls1
java full version "JDK1.2P"
Segmentation Fault
java full version "JDK-1.2beta2-W"
Segmentation Fault
java full version "JDK-1.2beta2-Z"
Segmentation Fault
java full version "JDK-1.2beta3-A"
java.lang.ClassCircularityError: cls1
java full version "JDK-1.2beta3-B"
java.lang.ClassCircularityError: cls1
java full version "JDK-1.2beta3-C"
Segmentation Fault
java full version "JDK-1.2beta3-D"
Segmentation Fault
java full version "JDK-1.2beta3-E"
Segmentation Fault
Hook 5(hook5): test
======================================================================