[kaffe] weird GC error with bad class format

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

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.
  Send mail to mime@docserver.cac.washington.edu for more info.

Content-type: TEXT/PLAIN; charset=US-ASCII

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.


Content-id: <Pine.OSF.4.10.10302030202210.379062@calliope.williams.edu>
Content-type: APPLICATION/octet-stream; name=A.class
Content-transfer-encoding: BASE64
Content-disposition: attachment; filename=A.class