class gc and gc_alloc(0, xxx)

Date view Thread view Subject view Author view

From: Parmelan, Edouard (EP510777@exchange.FRANCE.NCR.com)
Date: Fri Dec 18 1998 - 09:51:40 EST


Hi,

The new walkMethod() reveals an old bug in READMETHOD_START()
when METHODS_COUNT == 0.
It calls gc_malloc(0, GC_ALLOC_METHOD) :(

In other part, gc_malloc(0) aka gcMalloc(0) only allocates the
gc_unit overhead and returns a valid pointer.

As sizeof(gc_unit) < sizeof(Method), walkMethod() use a corrupted
Method struct and cause random SEGV in the gc thread.

I also found that READMETHODS_START() use GC_WRITE()
but READFILES_START() don't. As GC_WRITE() is currently
not implemented, I don't know witch one is correct.

The following patch:
- don't alloc a Method array if METHODS_COUNT == 0
  [as in READFIELDS_START()].
- add an assert(size != 0) in gcMalloc().

I forgot config/i386/linux/md.h in my -Wall patch yesterday,
so I join it today :)

Edouard.

---
 <<kaffe-mth.diff>> 



Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Sat Sep 23 2000 - 19:57:21 EDT