Re: SableVM on ARM fails to run HelloWorld

Etienne Gagnon <[email protected]> Mon, 28 Nov 2005 12:27:46 -0500
Newsgroups gmane.comp.java.vm.sablevm.general
Message-ID <[email protected]>
Hi Chris,

OK, so this confirms that the problem is class-library related.  The
internal bootstrap class loader seems to be working fine.  This can
greatly simplify your search for the bug.

For one thing, it seems that the System class loader is either:
1- not working at all, or
2- not looking in the current directory.

I suspect that "1-" is the case, here.  By putting the file in
<install-dir>/share/sablevm-classpath, the class was probably loaded by
the bootstrap class loader (i.e. sablevm's internal class loader).

You should start your investigation at
ClassLoader.defaultGetSystemClassLoader() in sablevm-classpath.

As this happens out of the bootstrap cycle, you can probably add
"System.out.println()" statements to track down execution without
hitting chicken-egg bootstrap problems.  In last resort, SableVM
provides java.lang package-specific VirualMachine.println() statements
which require no bootstrap support.

Have fun!

Etienne



Chris Develder wrote:
> I found that copying the HelloWorld.class file to
> <install-dir>/share/sablevm-classpath (alongside the jars) makes
> 'sablevm HelloWorld' work.
> 
> This lead me to believe that the current working directory was not
> checked when looking for HelloWorld.class. Yet, without the .class file
> in <install-dir>/share/sablevm-classpath, I did find (using strace) that
> the file in the pwd was looked for and opened... But then the
> java.lang.ClassFormatError occurs.
> 
> Apparently files in the classpath and pwd are not treated in the same way?
> 
>> Can you check what happens when mmap() is used to read the class file
>> insrc/libsablevm/class_loader.c (or src/libsablevm/zip_file_reader.c).
> 
> As for mmap: I added printfs before all mmap calls, but they were never
> reached.  I did notice failing open() calls using strace, where attempts
> are made to acces files that are actually in the jars in the classpath.
> (Making/installing sablevm-classpath uncompressed makes the open() calls
> work)  I guess that it is normal that in case of sablevm-classpath with
> compressed classfiles _svmf_bootcl_internal_load_ondisk_class_file is
> called and fails (for the .class files are in the jar)?

-- 
Etienne M. Gagnon, Ph.D.            http://www.info2.uqam.ca/~egagnon/
SableVM:                                       http://www.sablevm.org/
SableCC:                                       http://www.sablecc.org/

_______________________________________________
SableVM-user mailing list
[email protected]
http://sablevm.org/lists/control/listinfo/sablevm-user
signature.asc (application/pgp-signature, 256 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDiz4SjyrJi4rH84gRAqgHAJ4rxKPle6nRXodPPAYg3ZBO6jl1hgCePrmD
8Q5dKQfJQ2EKXDGP1CuO+G8=
=Ooor
-----END PGP SIGNATURE-----