[kaffe] MIPS JIT3 and null pointers.

Casey Marshall rsdio at metastatic.org
Fri Mar 19 16:26:02 PST 2004

Hash: SHA1

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

>> 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?  Can
Timothy> you check the EXCEPTIONFRAME macro in
Timothy> config/mips/linux/jit-md.h and make sure its sane.  You will
Timothy> want to make sure the MIPS_FP constant is correct for your
Timothy> ABI.

Ok, more info:

  1) __mipsGetNextFrame tries to determine the previous frame's
     program counter and frame pointer, based on the current pc and
     fp and walking up the code.

  2) When it tries to do this when walking back from a `soft' C
     method, it gets wrong values. In this case, it gets an address in
     `mips_do_fixup_trampoline' for the previous pc (which I think
     should be a jitted method instead), and a pointer to an instance
     of NullPointerException for the previous fp (this should be an
     address on the stack).

  3) The value for the previous frame pointer is invalid since it's
     way lower than the current frame pointer, so __mipsGetNextFrame
     fills in pc and fp with zero to mark what it thinks is the end of
     this stack.

The debug info printed from __mipsGetNextFrame looks like this:

 -> starting search at 0x4adb58
 ->  &ra = 0x4adb4c
 ->  prev pc = 0x52a7f8
 -> starting search at 0x4adb58
 -> Found at 0x4adb40: fp offset = 56
 ->  fp = 0x7fff7000
 ->  prev fp = 0x101ac678

`0x4adb58' is inside `soft_lookupinterfacemethod', `0x52a7f8' is
inside `mips_do_fixup_trampoline', and `0x101ac678' points to an
instance of NullPointerException.

I'm kind of suspicious of mips_do_fixup_trampoline.


- -- 
Casey Marshall || rsdio at metastatic.org
Version: GnuPG v1.2.3 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.7 <http://mailcrypt.sourceforge.net/>


More information about the kaffe mailing list