Archie Cobbs wrote:
With Classpath 0.16, trying to run a very simple Swing demo under JCVM,
I get a JNI assertion failure in a call to GetIntField(), because the object
type and the fieldID are not compatible:

gnu/java/awt/peer/gtk/[EMAIL PROTECTED] not instance of gnu/java/awt/peer/gtk/GtkGenericPeer

Here is the relevant stack trace snippet:

#7 0x29f862d7 in Java_gnu_java_awt_peer_gtk_GdkGraphics_initState__Lgnu_java_awt_peer_gtk_GtkComponentPeer_2 (env=0x107ed6a0, obj=0x29795698, peer=0x2979569c)
    at gnu_java_awt_peer_gtk_GdkGraphics.c:154

Hmm, no response.. can anyone else confirm this problem??

It looks like this code is completely broken, because
it's trying to save a pointer in a field that doesn't
exist. Line 154 of gnu_java_awt_peer_gtk_GdkGraphics.c says:

  NSA_SET_PTR (env, obj, g)

but "obj" is a gnu/java/awt/peer/gtk/GdkGraphics object, not
a gnu/java/awt/peer/gtk/GtkGenericPeer object, the class that
contains the "native_state" field.

I'm not familiar with this code so I could be completely
misunderstanding something. But it seems obviously wrong,
and on VM's that don't check proper JNI usage will result
in random memory corruption.

I'd appreciate a quick confirmation from another set of eyes...

Thanks,
-Archie

__________________________________________________________________________
Archie Cobbs      *        CTO, Awarix        *      http://www.awarix.com


_______________________________________________
Classpath mailing list
Classpath@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath

Reply via email to