Re: SableVM on ARM fails to run HelloWorld

Chris Develder <[email protected]> Fri, 25 Nov 2005 14:03:23 +0100
Newsgroups gmane.comp.java.vm.sablevm.general
Message-ID <[email protected]>
The HelloWorld.class works with native build of sablevm on my x86_64 
machine.

On the ARM system, the Java_java_lang_VMClassLoader_nativeDefineClass 
(libsablevm/java_lang_VMClassLoader.c) fails where it calls 
_svmh_parse_class_file (in libsablevm/class_file_parser.c), because the 
  class_file_length == 0 (which causes the first _svmh_parse_u32 call to 
retrieve the magic number from the .class file to fail).

So it seems something goes wrong when reading the HelloWorld.class file...

Cheers,
Chris.

Grzegorz B. Prokopski wrote:
> Hi Chris,
> 
> All you did looks all right to me, so we should be nailing the problem now.
> 
> A question.  If you compile the same SableVM sources on another architecture,
> say x86, does this HelloWorld.class file work?  If yes, then we're seeing an
> architecture specific problem here.  Please verify that, but for the rest of
> this email I assume the answer would be 'yes'.
> 
> In such case I think our class file parser has an architecture-specific
> problem, most probably related to endianness.  The best way to figure out
> what's going on is to debug SableVM and find the exact test that fails.  You
> want to set a breakpoint somewhere in class_file_parser.c, most probably
> _svmh_parse_class_file function is a good start.  If you don't have a
> debugger you can use printfs.  Just put a few and check what is the last one
> you see, then narrow down your area, and repeat.
> 
> HTH,
> 
> 		Grzegorz B. Prokopski
>