Bugzilla – Bug 322936
[GMCS] crash with interface-rooted class hierarchy in generic class
Last modified: 2007-09-15 21:24:23 UTC
---- Reported by andy.mortimer@ansys.com 2006-12-12 12:37:01 MST ---- 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. ---- Additional Comments From rharinath@novell.com 2006-12-16 14:51:38 MST ---- Should be fixed in SVN r69582 (testcase in SVN r69583). Unknown operating system unknown. Setting to default OS "Other".