Bug 322936 (MONO80242) - [GMCS] crash with interface-rooted class hierarchy in generic class
Summary: [GMCS] crash with interface-rooted class hierarchy in generic class
Status: RESOLVED FIXED
Alias: MONO80242
Product: Mono: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: 1.2
Hardware: Other Other
: P3 - Medium : Normal
Target Milestone: ---
Assignee: Raja R Harinath
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-12 19:37 UTC by Andy Mortimer
Modified: 2007-09-15 21:24 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 20:19:32 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".