[Mono-list] 0.17 bug

Paolo Molaro lupus@ximian.com
Wed, 18 Dec 2002 15:54:45 +0100


On 12/18/02 Jeroen Frijters wrote:
> I tried to run "Hello World" (compiled from Java, see http://jeroen.nu/)
> with the 0.17 (windows) build and got:
>  at slot 24: hashCode (-1) overrides GetHashCode (4)
>  at slot 24: equals (-1) overrides Equals (0)
>  at slot 24: toString (-1) overrides ToString (7)
> no implementation for interface method java.lang.reflect.Member::.cctor() in
> class java.lang.reflect.Constructor
[...]
> <message box>
> ** ERROR **: file class.c: line 693 (mono_class_setup_vtable): should not be
> reached
> aborting...
> </message box>
> 
> It seems that static methods in interfaces aren't handled correctly. Also,

Apply this patch in mono/metadata:

Index: class.c
===================================================================
RCS file: /cvs/public/mono/mono/metadata/class.c,v
retrieving revision 1.140
diff -u -r1.140 class.c
--- class.c	11 Dec 2002 17:27:56 -0000	1.140
+++ class.c	18 Dec 2002 14:44:19 -0000
@@ -672,7 +672,9 @@
 			if (!(class->flags & TYPE_ATTRIBUTE_ABSTRACT)) {
 				for (l = 0; l < ic->method.count; l++) {
 					char *msig;
-					MonoMethod *im = ic->methods [l];						
+					MonoMethod *im = ic->methods [l];
+					if (im->flags & METHOD_ATTRIBUTE_STATIC)
+							continue;
 					g_assert (io + l <= max_vtsize);
 					if (!(vtable [io + l])) {
 						for (j = 0; j < onum; ++j) {

> why are the first three lines printed?

It's part of the debug output for the error: we'll disable it and raise
an exception when mono is more mature.

I downloaded the binaries and compiled a hello world app. After the
change to class.c it still doesn't work, put it looks promising:

lupus@luna:/mnt/net/ikvm$ mono helloj.exe 
caught: System.NotImplementedException, handler: java.lang.Exception
System.NotImplementedException: The requested feature is not yet implemented
in <0x0002f> 00 System.Xml.Serialization.XmlSerializer:Deserialize (System.IO.Stream)
in <0x0024f> 00 .ClassLoaderWrapper:LoadRemappedTypes ()
in <0x00058> 00 .ClassLoaderWrapper:GetBootstrapClassLoader ()
in <0x0001a> 00 .ClassLoaderWrapper:GetType (string)
in <0x00073> 00 .ExceptionHelper:MapException (System.Exception,System.Type)
in <0x003e9> 00 gnu.java.io.EncodingManager:findDecoderConstructor (string,bool)
in <0x001c2> 00 gnu.java.io.EncodingManager:.cctor ()

It would help to know what the xml serialization is used for, maybe for
some simple types it's easy to implement to get ik.vm going.

Thanks!

lupus

-- 
-----------------------------------------------------------------
lupus@debian.org                                     debian/rules
lupus@ximian.com                             Monkeys do it better