classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

GNU Classpath + JRVM -- JNI methods


From: John Leuner
Subject: GNU Classpath + JRVM -- JNI methods
Date: Tue, 5 Mar 2002 16:40:42 +0000
User-agent: Mutt/1.3.27i

Hello everyone

(I've copied this message to the Classpath mailing list, but please reply on 
the jikes researchers list)

I've been making good progress with my port of the GNU Classpath java class 
libraries ( http://www.gnu.org/software/classpath/classpath.html ) to the Jikes 
RVM.

Currently I can run a hello world program (prints "hello world" to System.out) 
with most of the library classes coming from Classpath rather than the IBM OTI 
class libraries.

My short term aim is to run hello world with only Classpath and JRVM code (no 
OTI code).

To do this I still need to implement some java.io classes.

Classpath implements the functionality for these classes through JNI method 
calls to shared object libraries. 

I tried to set the LD_LIBRARY_PATH variable to the relevant directory for the 
libjavaio.so file, but when I try run this on Linux/IA32 I get this stack trace:

VM_Class: (begin) load LMainThread;
VM_DynamicLibrary looking for symbol Java_java_io_File_existsInternal
Got symbol address 1073842048 for Java_java_io_File_existsInternal
vm internal error at:

-- Stack --
   LVM; sysFail(Ljava/lang/String;)V at line 419
   LVM; _assertionFailure(Ljava/lang/String;)V at line 285
   LVM; assert(ZLjava/lang/String;)V at line 278
   LVM; assert(Z)V at line 261
   LVM_JNICompilerInfo; getExceptionDeliverer()LVM_ExceptionDeliverer; at
   line 32
   LVM_Runtime; deliverException(Ljava/lang/Throwable;LVM_Registers;)V at
   line 902
   LVM_Runtime; deliverHardwareException(II)V at line 735
   L<hardware>; <trap>()V at line 0
   Ljava/io/File; existsInternal(Ljava/lang/String;)Z at line 0
   Ljava/io/File; exists()Z at line 695
   Ljava/io/File; canRead()Z at line 563
   LVM_ClassLoader;
   searchRepositories(Ljava/lang/String;[Ljava/lang/String;)LVM_BinaryData;
   at line 589
   LVM_ClassLoader;
   getClassOrResourceDataInternal(Ljava/lang/String;)LVM_BinaryData; at
   line 514
   LVM_ClassLoader;
   getClassOrResourceData(Ljava/lang/String;)LVM_BinaryData; at line 488
   LVM_Class; load()V at line 742
   LVM_Runtime; initializeClassForDynamicLink(LVM_Class;)V at line 487
   LVM_Runtime; newScalar(I)Ljava/lang/Object; at line 214
   LVM; boot()V at line 216
vm: exit 1

Maria Butrico has suggested that JNI might be failing because it's too early in 
the system boot process. However this is happening in VM.boot here:

    VM_Collector.postBoot();

    // Work around class incompatibilities in boot image writer
    // (JDK's java.lang.Thread does not extend VM_Thread) [--IP].
--->Thread    xx         = new MainThread(applicationArguments);
    int       yy         = VM_Magic.objectAsAddress(xx);
    VM_Thread mainThread = (VM_Thread)VM_Magic.addressAsObject(yy);

I imagine that JNI should be working at this stage.

Whether I can get JNI to work or not might be a moot point. I assume the OTI 
libraries have been changed to use the sysCall methods (see VM_BootRecord) and 
it might be better for me to adapt the Classpath libraries to use these methods.

What do you think?

John Leuner








reply via email to

[Prev in Thread] Current Thread [Next in Thread]