[kaffe] MIPS JIT3 and null pointers.

Casey Marshall rsdio at metastatic.org
Fri Mar 19 10:48:02 PST 2004


>>>>> "Timothy" == Timothy Stack <stack at cs.utah.edu> writes:

>>  Or: is it even possible to build a stack frame from one of Kaffe's
>> internal C functions?

Timothy> I would think so.

Ok. I found a workaround (explicitly checking `obj' for null in
soft_lookupinterfacemethod and calling soft_nullpointer if it is), but
it sounds like something in the MIPS backend is the real problem.

>> buildStackFrame stops at soft_lookupinterfacemethod because it is
>> is not a part of the current thread; i.e. jthread_on_current_stack
>> returns false when an address in soft_lookupinterfacemethod is
>> called.

Timothy> Whats the value, does it make sense as a stack pointer?

This is what the final calls to jthread_on_current_stack look like,
using unix-pthreads:

jthread_on_current_stack nt=0x1001e038 stackMin=0x7fef7658 stackMax=0x7fff7658 p=0x7fff6920
jthread_on_current_stack nt=0x1001e038 stackMin=0x7fef7658 stackMax=0x7fff7658 p=0x7fff6920
jthread_on_current_stack nt=0x1001e038 stackMin=0x7fef7658 stackMax=0x7fff7658 p=(nil)

The frame pointer for the call to soft_lookupinterfacemethod is
0x7fff6920.

Looking at this again it does look as though __mipsGetNextFrame is
prematurely ending its search.

Timothy> Can you check the EXCEPTIONFRAME macro in
Timothy> config/mips/linux/jit-md.h and make sure its sane.

Looks ok. I mean, it's really simple:

#define EXCEPTIONFRAME(f, c) \
        (f).return_frame = (void *)(unsigned long)(c)->sc_regs[MIPS_FP]; \
        (f).return_pc = (void *)(unsigned long)(c)->sc_pc

Timothy> You will want to make sure the MIPS_FP constant is correct
Timothy> for your ABI.

AFAIK, it is, and that the FP register is number 30.

Timothy> Also, does test/regression/NullPointerTest.java work for you?

Yes. The only failure is in the invokeinterface test of NullInvoke.

Timothy> Which threading package are you using
Timothy> (unix-jthreads/unix-pthreads)?

I've tried both, and I don't see any difference in Null*
tests. jthreads, however, fail things like CatchDeath and StopThread,
but only occasionally (!!!). pthreads seems to work ok.

Cheers.

-- 
Casey Marshall || rsdio at metastatic.org




More information about the kaffe mailing list