When a class extends another class which implements
an interface, and that interface is not in the classpath,
jikes crashes. I was able to reproduce this in Windows
2000 using Jikes version 1.22 and the following code.
Make directories A, B, and C
A\A.java:
public interface A
{
}
B\B.java:
public class B implements A
{
}
C\C.java
public class C extends B
{
}
Then, from the root directory:
jikes -cp d:\j2sdk1.4.2\jre\lib\rt.jar;A B\B.java
jikes -cp d:\j2sdk1.4.2\jre\lib\rt.jar;B C\C.java
The first line succesfully writes A.class and B.class.
The second line causes a window to appear that
says "jikes.exe has generated errors and will be closed
by Windows. You will need to restart the program. An
error log is being created"
Logged In: YES
user_id=41790
I am seeing this on solaris and linux amd_64.
I've traced it to line 1903 of class.cpp where
interf->supertypes_closure is null. If I add a null check
and skip over 1903 when null (which seems like a reasonable
thing to do), then it reports class not found. The class it
cannot find is compiled into a jar file and implements
interfaces defined in a third jar file. Javac works fine
when I leave this third jar file out of the compile time
classpath, but jikes 1.22 segfaults.
#2 0x000000000044f04c in Semantic::ProcessClassFile
(this=0xd313f0, type=0x12f5f40,
buffer=0x12b34a0 "Êþº¾", buffer_size=6937, tok=3640) at
class.cpp:1903
1903 type -> supertypes_closure -> Union(*interf
-> supertypes_closure);
(gdb) list
1896 for (i = class_data -> InterfacesCount() - 1; i
>= 0; i--)
1897 {
1898 class_info = class_data -> Interface(i);
1899 assert(class_info);
1900 TypeSymbol* interf = GetType(type,
class_info, pool, tok);
1901 type -> AddInterface(interf);
1902 type -> supertypes_closure ->
AddElement(interf);
1903 type -> supertypes_closure -> Union(*interf
-> supertypes_closure);
1904 if (! interf -> ACC_INTERFACE())
1905 type -> MarkBad();
1906 }
1907