[kaffe] RE: Re: Cannot run AWT on Kaffe

Ronald Sloot Ronald.Sloot at arm.com
Tue Jun 12 05:01:11 PDT 2007


I had this problem on my ARM build of Kaffe:

> kaffe -Xkaffe-xlib-awt WidgetsDemo
> java.lang.InternalError: Pointer class was not properly initialized 

Turns out this "java.lang.InternalError: Pointer class was not properly
initialized" error is getting caused as a result of libxawt.so not
exporting JNI_OnLoad. 

When the libxawt.so library gets loaded by loadNativeLibrary
(kaffe/kaffevm/external.c) it probes for JNI_OnLoad. If it doesn't find
it it goes on and eventually hits the internal error in
Java_java_awt_Toolkit_fntInitFont() when it tries to use
JCL_NewRawDataObject to return the font object. 

JCL_NewRawDataObject
(libraries/javalib/external/classpath/native/jni/classpath/jcl.c)
triggers the internal error because it finds dat (jclass)rawDataClass is
not setup. This variable is setup by JNI_OnLoad to the suited Pointer
object of the platform ("gnu/classpath/Pointer64" or
"gnu/classpath/Pointer32").

By modifying the Makefile in libraries/clib/awt/X/Makefile.in so that it
also exports JNI_xxx, the WidgetsDemo program continues.

	Makefile.in: -export-symbols-regex "^([Jj]ava|kaffe|JNI)_"

BTW, I am not certain if this is the correct fix but it does the trick
for me, but I definitely don't understand why anybody else is not
running into this problem either (with -Xkaffe-xlib-awt).

With this fix the WidgetsDemo completes its initialisation and I see a
filled rectangle being drawn but then nothing anymore. I think the next
problem is that for some reason events are not getting distributed. The
Paint event certainly isn't happening....

Anybody else that has seen this before and knows a fix ?

-- Ronald

> -----Original Message-----
> From: Ronald Sloot 
> Sent: 05 June 2007 13:29
> To: 'kaffe at kaffe.org'
> Subject: Re: Cannot run AWT on Kaffe
> 
> Hi, 
> 
> I am actually getting the same problem as Kelvin when I run 
> WidgetsDemo on kaffe 1.1.8-pre on ARM: 
> 
> > kaffe -Xkaffe-xlib-awt WidgetsDemo
> java.lang.InternalError: Pointer class was not properly initialized 
> 
> I am using the following config: 
> ./configure --with-engine=intrp --with-kaffe-x-awt 
> --disable-gconf-peer --disable-gtk-peer 
> 
> I build with gcc 4.1.1. 
> 
> Riccardo, since you didn't get the problem, can you let us 
> know what configuration you used and what target platform ? 
> 
> I build an x86 version too and that doesn't seem to have the problem. 
> 
> I actually also got the same problems on a 1.1.7 version. 
> Debugging it shows something goes wrong when the first event 
> dispatch thread is created and it calls the function 
> InheritableThreadLocal.newChildThread() in which it executes 
> Iterator keys = parentThread.locals.keySet.iterator(). 
> Something goes wrong in that iterator (parentThread != NULL). 
> 
> Does anybody have any ideas, things I can try ? 
> 
> When I add the -v option I get the following output leading 
> upto the error message: 
> 
> Loading 
> java/awt/EventQueue.class(/usr/local/kaffe/jre/lib/kaffeawt.ja
> r) [compressed] 
> Loading 
> java/awt/event/AWTEventListenerProxy.class(/usr/local/kaffe/jr
> e/lib/glibj.zip) [compressed] 
> Loading 
> java/util/EventListenerProxy.class(/usr/local/kaffe/jre/lib/gl
> ibj.zip) [compressed]Loading 
> java/awt/event/AWTEventListener.class(/usr/local/kaffe/jre/lib
> /kaffeawt.jar) [compressed] 
> Loading 
> java/awt/EventDispatchThread.class(/usr/local/kaffe/jre/lib/ka
> ffeawt.jar) [compressed] 
> Loading 
> java/lang/InheritableThreadLocal.class(/usr/local/kaffe/jre/li
> b/glibj.zip) [compressed] 
> Loading 
> java/util/AbstractMap$1.class(/usr/local/kaffe/jre/lib/glibj.z
> ip) [compressed] 
> Loading 
> java/util/AbstractMap$1$1.class(/usr/local/kaffe/jre/lib/glibj
> .zip) [compressed] 
> Loading 
> gnu/java/util/WeakIdentityHashMap$WeakEntrySet$1.class(/usr/lo
> cal/kaffe/jre/lib/glibj.zip) [compressed] 
> java.lang.InternalError: Pointer class was not properly initialized 
> 
> 
> Thanks 
> -- Ronald 
> 
> PS: 
> kaffe -fullversion produces: 
> .. 
> Engine: Interpreter   Version: 1.1.8-pre   Java Version: 1.4 
> Heap defaults: minimum size: 5 MB, maximum size: unlimited 
> Stack default size: 64 KB 
> Configuration/Compilation options: 
>   Compile date     : Tue Jun 5 11:10:24 SAST 2007 
>   Compile host     : debian 
>   Install prefix   : /usr/local/kaffe 
>   Thread system    : unix-pthreads 
>   Garbage Collector: kaffe-gc 
>   CC               : gcc 
>   CFLAGS           : -Wall -W -Wextra -fno-strict-aliasing 
> -fno-omit-frame-pointer -fsigned-char -pthread-g -O2 
>   LDFLAGS          : 
>   ChangeLog head   : 2007-05-26  Ito Kazumitsu  <kaz at maczuka.gcd.org> 
> 

-- 
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium.  Thank you.






More information about the kaffe mailing list