[Joeq-devel] NullPointerException in monitorenter.java (Bug?)
Status: Alpha
Brought to you by:
joewhaley
|
From: David A. R. <dtr...@um...> - 2008-08-15 20:42:54
|
Hi Everyone,
I've spent the greater part of this week trying to run a graphical
Java application inside Joeq (native mode) on Linux 2.6.9-67.0.1.ELsmp
with Sun JDK 1.5.0_01. My main problem is that System.loadLibrary is
not working properly when attempting to load the awt library. I fixed
one bug already in
joeq_native/joeq/ClassLib/sun14_linux/java/lang/System.java by
implementing mapLibraryName correctly.
The application gets as far as executing ClassLoader.loadLibrary0, and
executes the statement "synchronized(loadedLibraryNames){" (JDK1.5's
java/lang/ClassLoader.java:1714). This triggers
joeq.Runtime.Monitor.monitorenter(Object k), which crashes on a
NullPointerException because k is null. However, loadedLibraryNames
is an initialized static field inside JDK's ClassLoader class. So how
can it be null? I suspect that the problem has to do with the various
overloaded versions of ClassLoader inside Joeq, but I have not been
able to fix it. Below is a copy of the exception backtrace. Please
note that the line number for Monitor.java is off because I've added
debug statements to pinpoint the problem.
Has anyone successfully loaded shared JNI libraries from inside native
Joeq? Also, is there a good way to debug native Joeq? GDB won't do
much unless there's a seg fault.
Thanks in advance!
-David
java.lang.ExceptionInInitializerError
at java.lang.Throwable.fillInStackTrace(Throwable.java:57)
at java.lang.Throwable.<init>(Throwable.java:181)
at java.lang.Error.<init>(Error.java:37)
at java.lang.LinkageError.<init>(LinkageError.java:26)
at
java.lang.ExceptionInInitializerError.<init>(ExceptionInInitializerError.java:61)
at joeq.Class.jq_Class.invokeclinit(jq_Class.java:2448)
at joeq.Class.jq_Class.cls_initialize(jq_Class.java:2431)
at
joeq.Compiler.Reference.x86.x86ReferenceLinker.invokestatic(x86ReferenceLinker.java:183)
at java.awt.Component.<clinit>(Component.java:545)
at joeq.Runtime.ReflectionImpl.invokestatic_V(ReflectionImpl.java:326)
at
joeq.Compiler.Reference.x86.x86ReferenceLinker.invokeinterface(x86ReferenceLinker.java:220)
at joeq.Runtime.Reflection.invokestatic_V(Reflection.java:100)
at joeq.Class.jq_Class.invokeclinit(jq_Class.java:2442)
at joeq.Class.jq_Class.cls_initialize(jq_Class.java:2431)
at joeq.Class.jq_Class.cls_initialize(jq_Class.java:2427)
at joeq.Class.jq_Class.cls_initialize(jq_Class.java:2427)
at joeq.Class.jq_Class.cls_initialize(jq_Class.java:2427)
at joeq.Class.jq_Class.cls_initialize(jq_Class.java:2427)
at joeq.Main.JoeqVM.boot(JoeqVM.java:216)
Caused by: java.lang.NullPointerException
at java.lang.Throwable.fillInStackTrace(Throwable.java:57)
at java.lang.Throwable.<init>(Throwable.java:181)
at java.lang.Exception.<init>(Exception.java:29)
at java.lang.RuntimeException.<init>(RuntimeException.java:32)
at java.lang.NullPointerException.<init>(NullPointerException.java:36)
at
joeq.Runtime.ExceptionDeliverer.trap_handler(ExceptionDeliverer.java:50)
at joeq.Runtime.Monitor.monitorenter(Monitor.java:64)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1714)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668)
at java.lang.Runtime.loadLibrary0(Runtime.java:822)
at java.lang.System.loadLibrary(System.java:49)
at
sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:50)
at
joeq.Compiler.Reference.x86.x86ReferenceLinker.invokeinterface(x86ReferenceLinker.java:220)
at
java.security.AccessController.doPrivileged(AccessController.java:16)
at sun.awt.NativeLibLoader.loadLibraries(NativeLibLoader.java:38)
at sun.awt.DebugHelper.<clinit>(DebugHelper.java:29)
at joeq.Runtime.ReflectionImpl.invokestatic_V(ReflectionImpl.java:326)
at
joeq.Compiler.Reference.x86.x86ReferenceLinker.invokeinterface(x86ReferenceLinker.java:220)
at joeq.Runtime.Reflection.invokestatic_V(Reflection.java:100)
at joeq.Class.jq_Class.invokeclinit(jq_Class.java:2442)
... 13 more
|