using Kaffe AWT under another JVM

Tomas Sieger TSIE4391 at barbora.mff.cuni.cz
Mon Oct 5 03:39:09 PDT 1998


Hi,

I've tried to port Kaffe 1.0.b1 AWT under Sun's JDK 1.1.5, but
when I'he run program:


import java.awt.*;
import java.io.*;
import java.util.*;

class AA {
    public static void main (String[] args) {
        Frame f=new Frame ("Frejmik");
                f.show ();
    }
}


I've noticed some problems:


SIGSEGV   11*  segmentation violation
    stackbase=0xbffff9a0, stackpointer=0xbffff8a0
Full thread dump:
    "Finalizer thread" (TID:0x4062fbf8, sys_thread_t:0x41378e0c,
state:R)  prio=1
    "Async Garbage Collector" (TID:0x4062fc40, 
sys_thread_t:0x41357e0c,
state:R) prio=1
    "Idle thread" (TID:0x4062fc88, sys_thread_t:0x41336e0c, state:R)
prio=0
    "Clock" (TID:0x4062c088, sys_thread_t:0x41315e0c, state:CW) 
prio=12
    "main" (TID:0x4062c0b0, sys_thread_t:0x815e7b8, state:R) prio=5
*current thread*
    java.awt.Font.<init>(Font.java:55)
    java.awt.Defaults.<clinit>(Defaults.java:163)
    java.awt.Window.<init>(Window.java:27)
    java.awt.Window.<clinit>(Window.java:25)
    AA.main(AA.java:6)
Monitor Cache Dump:
    java.lang.Class at 1080229736/1080636200: owner "main" (0x815e7b8, 1
entry)
    java.lang.Class at 1080229288/1080634720: owner "main" (0x815e7b8, 2
entries)
    java.lang.Class at 1080229312/1080634488: owner "main" (0x815e7b8, 1
entry)
    java.lang.Class at 1080229416/1080634616: owner "main" (0x815e7b8, 1
entry)
    java.lang.Class at 1080229080/1080635952: owner "main" (0x815e7b8, 1
entry)
Registered Monitor Dump:
    Thread queue lock: <unowned>
    Name and type hash table lock: <unowned>
    String intern lock: <unowned>
    JNI pinning lock: <unowned>
    JNI global reference lock: <unowned>
    BinClass lock: <unowned>
    Class loading lock: <unowned>
    Java stack lock: <unowned>
    Code rewrite lock: <unowned>
    Heap lock: <unowned>
    Has finalization queue lock: <unowned>
    Finalize me queue lock: <unowned>
    Monitor IO lock: <unowned>
    Child death monitor: <unowned>
    Event monitor: <unowned>
    I/O monitor: <unowned>
    Alarm monitor: <unowned>
    Waiting to be notified:
        "Clock" (0x41315e0c)
    Monitor registry: owner "main" (0x815e7b8, 1 entry)
Thread Alarm Q:



The problem occurs when returning native pointer back into Java.
Font.java contains something like:

kaffe.util.Ptr nativeData=Toolkit.fntInitFont(...)

Toolkit.fntInitFont is declared native, it returns Ptr.
native implementation returns void * and that's the problem - this
return causes
segmentation fault (but when returning (void *) 0, nothing happens - 
JVM
checks whether Ptr is valid reference???).


Please, is possible to port Kaffe AWT under another JVM supporting JNI
(e.g. JDK)?
Does Kaffe AWT 100% support JNI?

I run Redhat Intel Linux 5.0.
I've tried porting the way I've replaced java awt classes with kaffe 
awt
classes 
and ran:

java -classpath <...> -Dawt.toolkit=java.awt.toolkit Program


Enjoy coffee!!
            Tomas Sieger





More information about the kaffe mailing list