Kaffe runs(!) under VC++

Michael Gesundheit mikeg at rocketmail.com
Fri Oct 31 19:16:47 PST 1997


Well, it was a long week in which I learnt kaffe and
VC++.

I just got kaffe to spit HelloWorld! for the first
time under VC++ 5.0. I would not call it running yet
before it will pass the entire test package but this is
a start and more important if anybody out there would
like to help it will be great.

The main bug was, and here I'm looking for explanation
help, was the following:

First, the bug menifest itself deep down in Java code
when trying to do the print of HelloWorld the VM
crashed. It crashed when Java stack slot had a field
pointer to the "out" field of the FileDescriptor class
which was 0. Why? here is the bug:

javah uses a stack_item union to pass parameters in the
stubs it generates. The union:

typedef union {




---"John D. Gwinner" <gwinner at northnet.org> wrote:
>
> 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 ==
> 
> 
> 

_____________________________________________________________________
Sent by RocketMail. Get your free e-mail at http://www.rocketmail.com



More information about the kaffe mailing list