[kaffe] weird GC error with bad class format

gonzo Robert.N.Gonzalez at williams.edu
Sun Feb 2 23:02:01 PST 2003

Hi everyone.

i'm currently modifying kaffe's verifier (not posted yet because i'm
trying to get it more or less bug-for-bug compatible with Sun...they don't
really follow their own damn spec too closely, it turns out) and class
loader to take advantage of a GJ-like signature for running generic code

the problem comes when the GJ Signature attribute is malformed.  the
method readAttribute() in readClass.c returns false, and

   kaffe-bin: mem/gc-incremental.c:1064: gcFree: Assertion `!!!"Attempt to
              explicitly free nonfixed object"' failed.

is what i get.  this is bad because that means whenever a class file is
corrupted a little bit (or at least the attributes in a class file are
corrupted) and readAttribute returns false, this pretty bad thing happens.

to reproduce this, simply add the following case to readAttribute:

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

i've attached a simple compiled GJ class to try out so you don't have to
go downloading that as well (it's tough to intentionally corrupt an
attribute in a class file, and most people don't have compilers that
produce non-standard attributes on hand).

i would check this out myself, but i know pretty much zero about how
kaffe's memory allocation/deallocation is handled.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: A.class
Type: application/octet-stream
Size: 315 bytes
Url : http://kaffe.org/pipermail/kaffe/attachments/20030202/032251b0/attachment-0003.obj 

More information about the kaffe mailing list