[Mono-bugs] [Bug 674224] New: Compiler crashes with NullReferenceException - worked with mono 2.8.2

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Feb 23 01:57:49 EST 2011


https://bugzilla.novell.com/show_bug.cgi?id=674224

https://bugzilla.novell.com/show_bug.cgi?id=674224#c0


           Summary: Compiler crashes with NullReferenceException - worked
                    with mono 2.8.2
    Classification: Mono
           Product: Mono: Compilers
           Version: 2.10.x
          Platform: x86
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: msafar at novell.com
        ReportedBy: ohh at scisoft.dk
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; da; rv:1.9.2.13)
Gecko/20101203 Firefox/3.6.13 ( .NET CLR 3.5.30729; .NET4.0E)

I get a NullReferenceException when referencing an assembly that contains some
complex generic constraints.

This built without problems in mono 2.8.2 (probably also .NET, although I have
not tested the specific test file given below).

Reproducible: Always

Steps to Reproduce:
-bash-4.1$ cat Asm1.cs
class G<T>
        where T : G<T>.GPD
{
        public interface IGD {}

        public class GPD : IGD
        {
        }
    }
-bash-4.1$ cat Test.cs
public class MyTest
{
        public static void Main (string[] args) {
                System.Console.WriteLine ("OK");
        }
}
-bash-4.1$ mcs Asm1.cs -target:library -out:Asm1.dll
-bash-4.1$ mcs Test.cs -r:Asm1.dll

Actual Results:  
Unhandled Exception: System.NullReferenceException: Object reference not set to
an instance of an object
  at Mono.CSharp.MetadataImporter.CreateType (IKVM.Reflection.Type type,
Mono.CSharp.TypeSpec declaringType, DynamicTypeReader dtype, Boolean
canImportBaseType) [0x00000] in <filename unknown>:0
  at Mono.CSharp.MetadataImporter.CreateType (IKVM.Reflection.Type type,
DynamicTypeReader dtype, Boolean canImportBaseType) [0x00000] in <filename
unknown>:0
  at Mono.CSharp.MetadataImporter.CreateType (IKVM.Reflection.Type type)
[0x00000] in <filename unknown>:0
  at Mono.CSharp.MetadataImporter.CreateTypeParameter (IKVM.Reflection.Type
type, Mono.CSharp.TypeSpec declaringType) [0x00000] in <filename unknown>:0
  at Mono.CSharp.MetadataImporter.CreateType (IKVM.Reflection.Type type,
Mono.CSharp.TypeSpec declaringType, DynamicTypeReader dtype, Boolean
canImportBaseType) [0x00000] in <filename unknown>:0
  at Mono.CSharp.MetadataImporter.CreateType (IKVM.Reflection.Type type,
DynamicTypeReader dtype, Boolean canImportBaseType) [0x00000] in <filename
unknown>:0
  at Mono.CSharp.MetadataImporter.CreateGenericParameters (Int32 first,
IKVM.Reflection.Type[] tparams) [0x00000] in <filename unknown>:0
  at Mono.CSharp.MetadataImporter.CreateGenericParameters (IKVM.Reflection.Type
type, Mono.CSharp.TypeSpec declaringType) [0x00000] in <filename unknown>:0
  at Mono.CSharp.MetadataImporter.CreateType (IKVM.Reflection.Type type,
Mono.CSharp.TypeSpec declaringType, DynamicTypeReader dtype, Boolean
canImportBaseType) [0x00000] in <filename unknown>:0
  at Mono.CSharp.MetadataImporter.ImportTypes (IKVM.Reflection.Type[] types,
Mono.CSharp.Namespace targetNamespace, Boolean hasExtensionTypes) [0x00000] in
<filename unknown>:0
  at Mono.CSharp.StaticImporter.ImportAssembly (IKVM.Reflection.Assembly
assembly, Mono.CSharp.RootNamespace targetNamespace) [0x00000] in <filename
unknown>:0
  at Mono.CSharp.StaticLoader.LoadReferences (Mono.CSharp.ModuleContainer
module) [0x00000] in <filename unknown>:0
  at Mono.CSharp.Driver.Compile () [0x00000] in <filename unknown>:0
  at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] in <filename
unknown>:0


Expected Results:  
The program should compile without errors or warnings.

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list