[Mono-bugs] [Bug 80242][Nor] New - gmcs crash with interface-rooted class hierarchy in generic class

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Tue Dec 12 12:37:02 EST 2006


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by andy.mortimer at ansys.com.

http://bugzilla.ximian.com/show_bug.cgi?id=80242

--- shadow/80242	2006-12-12 12:37:02.000000000 -0500
+++ shadow/80242.tmp.13214	2006-12-12 12:37:02.000000000 -0500
@@ -0,0 +1,89 @@
+Bug#: 80242
+Product: Mono: Compilers
+Version: 1.2
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: C#
+AssignedTo: rharinath at novell.com                            
+ReportedBy: andy.mortimer at ansys.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: gmcs crash with interface-rooted class hierarchy in generic class
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+
+Crash in the gmcs compiler, when referencing a generic class containing an
+interface-rooted class hierarchy:
+
+public class OptionHandler<T>
+{
+    interface IOptionHandler { }
+    class OptionHandlerBase : IOptionHandler { }
+    class OptionHandlerWithArgument : OptionHandlerBase { }
+}
+
+The compilation appears to succeed, but then trying to build another
+assembly which references that type crashes with
+
+** ERROR **: file class.c: line 2444 (mono_class_init): assertion failed:
+(class->interface_count == gklass->interface_count)
+
+If both the definition and the reference are in the same assembly
+everything is fine.
+
+Steps to reproduce the problem:
+1. Create a file one.cs containing
+
+// start of one.cs
+class Program {
+    static void Main() { }
+}
+
+public class OptionHandler<T>
+{
+    interface IOptionHandler { }
+    class OptionHandlerBase : IOptionHandler { }
+    class OptionHandlerWithArgument : OptionHandlerBase { }
+}
+// end of one.cs
+
+and a file two.cs containing
+
+// start of two.cs
+public class TestCmdLine
+{
+    public static void Main() {
+        new OptionHandler<object>();
+    }
+}
+// end of two.cs
+
+2. gmcs /target:library one.cs
+3. gmcs /reference:one.dll two.cs
+
+Actual Results:
+
+popup dialog box at step 3, containing the text ** ERROR **: file class.c:
+line 2444 (mono_class_init): assertion failed: (class->interface_count ==
+gklass->interface_count)
+
+Expected Results:
+
+Successful compilation.
+
+How often does this happen? 
+
+Every time.
+
+Additional Information:
+
+I first hit this with 1.1.18, but I've now upgraded to 1.2.2.1 and it's
+still failing.


More information about the mono-bugs mailing list