Kaffe bug on PC

John D. Gwinner gwinner at northnet.org
Thu Oct 30 19:34:27 PST 1997


Michael:

> ---"John D. Gwinner" <gwinner at northnet.org> wrote:

> > Just to cover all bases, have you examined the
> packing (#pragma pack)? 
> 
 No, under 0.9.2 the thread package does not require
> assembly. setjmp/longjmp is used.

? #pragma pack is useful even if you aren't using assembly;
I'm not sure what that has to do with setjmp/longjmp.  Maybe I'm not
following.  If you are reading 0's in structures that should have value,
this is often because the #pragma pack is wrong.  I've had problems with
this in the past.  (setting pack is a bad thing of course, but at least an
Intel machine doesn't GPF when a structure isn't aligned, but it does slow
down.).


> The problem as I see it at this point is not a union
> issue. I realized today that the problem comes from
> the initial GETSTATIC opcode processing. The
> move_ref_const macro moves the pointer
> field->info.addr to tmp which is a slots pointer then
> the macro load_ref move the contant, which is 0 (!!) to
> the stack. Later on the bytecode INVOKEVIRTUAL takes
> this stack entry as a pointer and crashes. At this 
> point I think the bug is in initializing my 
> HelloWorldApp class. This missing pointer should be 
> set when the class is loaded and processed. I hope
> that the Solaris I have next to the PC will help
> tracing the class initialization.

Hmm ... you mean the pointer is written to tmp properly, then it suddenly
becomes 0? Sounds like a wild pointer somewhere.  Set a break point on
that memory address and see what changes it to 0.  OR -- trace the macro
to make sure it's doing what it's supposed to.

I'm probably out of juice on this one, thought I could help.

		== John ==



More information about the kaffe mailing list