Bug 467834

Summary: mono_method_get_vtable_slot assertion when compiling Nemerle
Product: [Mono] Mono: Runtime Reporter: Evin Robertson <evin.robertson>
Component: miscAssignee: Mono Bugs <mono-bugs>
Status: RESOLVED DUPLICATE QA Contact: Mono Bugs <mono-bugs>
Severity: Normal    
Priority: P5 - None CC: alex.baibarin, bjorn.lisper, divanorama, emperon, forgotten_vxPDddArjq, nazgul, s-kiess
Version: 2.2.x   
Target Milestone: 2.6.x   
Hardware: x86-64   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Evin Robertson 2009-01-21 04:34:57 UTC
Description of Problem:
System.Reflection is broken for Nemerle again.


Steps to reproduce the problem:
1. Download, compile, and install Mono 2.2 to /usr/local/bin
2. Download a recent version of Nemerle (I tried with 0.9.3.99.8218 and 0.9.3.99.8160)
3. configure Nemerle to point at Mono 2.2 (./configure --mono-from=/usr/local/bin)
4. run make


Actual Results:

A SIGABRT is received during compilation:

** ERROR:(class.c:3259):mono_method_get_vtable_slot: assertion failed: (method->slot != -1)
Stacktrace:

  at (wrapper managed-to-native) System.MonoType.GetPropertiesByName (string,System.Reflection.BindingFlags,bool,System.Type) <0x00051>
  at (wrapper managed-to-native) System.MonoType.GetPropertiesByName (string,System.Reflection.BindingFlags,bool,System.Type) <0xffffffff>
  at System.MonoType.GetProperties (System.Reflection.BindingFlags) [0x00000] in /tmp/mono-2.2/mcs/class/corlib/System/MonoType.cs:259
  at System.Reflection.Emit.TypeBuilder.GetProperties (System.Reflection.BindingFlags) [0x0000b] in /tmp/mono-2.2/mcs/class/corlib/System.Reflection.Emit/TypeBuilder.cs:1282
  at System.Reflection.MonoGenericClass.initialize () [0x00024] in /tmp/mono-2.2/mcs/class/corlib/System.Reflection/MonoGenericClass.cs:108
  at System.Reflection.MonoGenericClass.GetConstructor (System.Reflection.ConstructorInfo) [0x00000] in /tmp/mono-2.2/mcs/class/corlib/System.Reflection/MonoGenericClass.cs:187
  at System.Reflection.Emit.TypeBuilder.GetConstructor (System.Type,System.Reflection.ConstructorInfo) [0x00000] in /tmp/mono-2.2/mcs/class/corlib/System.Reflection.Emit/TypeBuilder.cs:1804
  at Nemerle.Compiler.ILEmitter.FrameworkGetConstructor (System.Type,System.Reflection.ConstructorInfo) <0x000e7>


Expected Results:

It should compile without errors, like it does with Mono 2.0.


How often does this happen? 

Every time.

Additional Information:
Comment 1 Forgotten User vxPDddArjq 2009-01-21 17:43:32 UTC
-> runtime.

Interestingly, this seems to work fine with HEAD.

The original assert is now fixed in HEAD/2.4/2.2 branches, but there is a new
one:

** ERROR:(reflection.c:2543):get_field_on_inst_generic_type: assertion failed: (field_index >= 0 && field_index < dgclass->count_fields)
Comment 2 Rodrigo Kumpera 2009-01-21 18:12:57 UTC
This looks like the well know SRE generic instantiation problem. No easy solution.
Comment 3 Kamil Skalski 2009-01-22 06:15:47 UTC
Is there a main bug for the generic instantiation problem?
Comment 4 Aleksey Baibarin 2009-03-13 09:51:22 UTC
(In reply to comment #2)
> This looks like the well know SRE generic instantiation problem. No easy
> solution.

As a matter of fact: it compiles fine with Mono 2.0.1
Comment 5 Dmitry Ivankov 2009-03-13 10:21:36 UTC
Yes, but not with 2.2 or svn versions, haven't tried to do binary search on revisions yet.
Comment 6 Dmitry Ivankov 2009-08-02 08:25:55 UTC
Hello guys!
Just in case, is this bug easy for you to reproduce or maybe you need some verbose log or reduced to minimum C# source with the same assertion? And also will the number of breaking revision help you in any way?
Comment 7 Forgotten User vxPDddArjq 2009-08-02 12:41:31 UTC
No, we know what the problem is, its just it is a bit hard to fix.
Comment 8 Rodrigo Kumpera 2009-08-04 00:14:37 UTC
Dmitry, this is been worked on and should be working in a couple of weeks.
Comment 9 Rodrigo Kumpera 2009-10-19 19:00:49 UTC
*** Bug 542690 has been marked as a duplicate of this bug. ***
Comment 10 Onur Gumus 2009-11-23 12:06:36 UTC
this issue still exits in a different manner

ERROR:reflection.c:2612:get_field_on_inst_generic_type: assertion failed:
(field_index >= 0 && field_index < dgclass->count_fields)
Stacktrace:

  at (wrapper managed-to-native) System.MonoType.GetField
(System.MonoType*,string,System.Reflection.BindingFlags) <0x00051>
  at (wrapper managed-to-native) System.MonoType.GetField
(System.MonoType*,string,System.Reflection.BindingFlags) <0x00051>
  at System.MonoType.GetField (System.Reflection.FieldInfo) <0x00088>
  at System.Reflection.Emit.TypeBuilder.GetField


and reissued on bug
https://bugzilla.novell.com/show_bug.cgi?id=555464
Comment 11 Forgotten User vxPDddArjq 2010-04-01 03:13:46 UTC
closing this as a dup.

*** This bug has been marked as a duplicate of bug 555464 ***