[kaffe] the terrible segmentation fault

Noa Resare noa at resare.com
Fri Nov 5 03:48:33 PST 2004

ons 2004-11-03 klockan 18:09 +0800 skrev 程明:
> Hi,everyone,
> I have two problems:
> 1.When I run my ported Kaffe on THUMP 107, Kaffe runs into the
> initBaseClasses() function of baseClasses.c, each execution of
> loadStaticClass(&javaLangDoubleClass, "java/lang/Double");
> loadStaticClass(&javaLangVMThrowable, "java/lang/VMThrowable");
> loadStaticClass(&javaLangNoClassDefFoundError,
> "java/lang/NoClassDefFoundError");
> loadStaticClass(&javaLangStackOverflowError,
> "java/lang/StackOverflowError");
> can cause a segmentation fault, and the kernel aborts kaffe.
> And I notice that the execution of Line 127 & 128 in readClass.c causes
> the segmentation fault.
> sizeof(Hjava_lang_Class**) * interfaces_count is 4 when loading
> java.lang.Float
> sizeof(Hjava_lang_Class**) * interfaces_count is also 4 when loading
> java.lang.Double. Then segmentation fault occurs. Is it because 4 is not
> enough for java.lang.Double?
> I would like to know why other classes don't cause segmentation fault
> but those 4 classes. Are there any differences?
> 2.After I put those 4 lines into /* */, another segmentation fault
> occurs. This time the segmentation fault occurs at
> processClass(StringClass, CSTATE_COMPLETE, &einfo)
> in baseClasses.c.
> And one of my PCs which is 80X86-Linux platform causes a segmentation
> fault at the same place but another one doesn't. Maybe this function
> contains a bug.
> Best wishes,
> Cheng Ming

Hello Cheng

I can't really follow what you write above, and I don't have access to
any THUMP 107 hardware. However, if you can write a small self-contained
test that produces a segmentation fault (as in problem 2 above) with the
latest kaffe snapshot from cvs on i386-linux I will have a look at it.


More information about the kaffe mailing list