[kaffe] weird GC error with bad class format

gonzo Robert.N.Gonzalez at williams.edu
Mon Feb 3 17:50:02 PST 2003


Hi Tim and Dalibor.


> Could you post it anyways?  Itd be nice to take a look at it.

subroutine verification is still kinda buggy, mostly because i don't like
the way Sun handles them.  it is actually possible to write Java programs
that, even when compiled with Sun's javac, do not pass verification.
here's one such reasonably well-known program:

	class FailsVerification {
	        int m1(boolean b) {
	                int i;
	                try {
	                     if (b) return 1;
	                     i = 2;
	                } finally {
	                        if (b) i = 3;
	                }
	                return i;
	        }
	}

the JSR-RET pairs, which are necessary to implement try-finally clauses,
cause the single greatest problem with verification. the approach that i'm
taking is a polyvariant one that theoretically will pass *all* legal Java
progams, which neither Sun's verifier nor BCEL's JavaIce can claim to do.
unfortunately, it's been a little challenging to get it working.

basically, once i get that working and polish up my code a little bit,
i'll post the patch for you to test out.  no use posting something that's
not going to pass a lot of programs yet.  not sure how long that's going
to take...the research that i'm doing takes priority.  i'm sure you all
know how that goes :)


> Are you using the current CVS?

i just downloaded a fresh copy of the current CVS, applied the patch Tim
posted and then made the change in readAttributes (readClass.c) that i
suggested earlier which is simply to add this case into the list of cases:

	else if (!strcmp(name->data, "Signature") {
		return false;
	}

compiled it, and ran it on the class i put in my last post <
http://www.kaffe.org/pipermail/kaffe/2003-February/028761.html > and
received the following error this time:

	Exception thrown on null object ... aborting
	Aborted

the gdb output is below.

cheers,
~rob


(gdb) run
Starting program: /home/gonzo/work/thesis/kaffe/jre/bin/kaffe-bin A
Exception thrown on null object ... aborting


Program received signal SIGABRT, Aborted.
0x400c6911 in kill () from /lib/libc.so.6
(gdb) bt
#0  0x400c6911 in kill () from /lib/libc.so.6
#1  0x400c6732 in raise () from /lib/libc.so.6
#2  0x400c7846 in abort () from /lib/libc.so.6
#3  0x4002d9f5 in throwException (eobj=0x0) at exception.c:231
#4  0x4002d9bf in throwError (einfo=0xbfffdb54) at exception.c:217
#5  0x402701e5 in kaffe_lang_SystemClassLoader_findClass0 (this=0x80efcd8,
str=0x813ac88) at SystemClassLoader.c:114
#6  0x0813d125 in ?? ()
#7  0x081426c4 in ?? ()
#8  0x081421d7 in ?? ()
#9  0x0813caf5 in ?? ()
#10 0x08119be9 in ?? ()
#11 0x4004b772 in callMethodV (meth=0x8087010, func=0x8119bb0, obj=0x0,
args=0xbfffe018, ret=0xbfffdf90) at ../../config/i386/common.h:45
#12 0x4004aafd in do_execute_java_class_method_v (cname=0x4006cbee
"java.lang.Class", loader=<incomplete type>, method_name=0x4006cbe6
"forName", 
    signature=0x4006cbc0 "(Ljava/lang/String;)Ljava/lang/Class;",
argptr=0xbfffe014) at support.c:203
#13 0x4004ab4b in do_execute_java_class_method (cname=0x4006cbee
"java.lang.Class", loader=<incomplete type>, method_name=0x4006cbe6
"forName", 
    signature=0x4006cbc0 "(Ljava/lang/String;)Ljava/lang/Class;") at
support.c:216
#14 0x4003626e in Kaffe_FindClass (env=0x40071910, name=0xbfffe785 "A") at
jni.c:347
#15 0x08048bfc in main2 (env=0x40071910, argv=0xbfffe5d4, farg=2, argc=0)
at main.c:206
#16 0x08048bad in main (argc=2, argv=0xbfffe5d4) at main.c:145





More information about the kaffe mailing list