[Mono-bugs] [Bug 742833] New: Compiler crashes with NullReferenceException in MetaDataImporter

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Jan 23 11:26:53 UTC 2012


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

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


           Summary: Compiler crashes with NullReferenceException in
                    MetaDataImporter
    Classification: Mono
           Product: Mono: Compilers
           Version: 2.10.x
          Platform: 64bit
        OS/Version: Windows 7
            Status: NEW
          Severity: Critical
          Priority: P5 - None
         Component: C#
        AssignedTo: michael.miller at suse.com
        ReportedBy: m3bcenptpm at snkmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


User-Agent:       Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.7 (KHTML,
like Gecko) Chrome/16.0.912.75 Safari/535.7

I have a large project which previously compiled and worked in Visual Studio. 
When attempting to compile with Mono I get the following crash:


Unhandled Exception: System.NullReferenceException: Object reference not set to
an instance of an object

  at Mono.CSharp.MetadataImporter.CreateType (System.Type type,
Mono.CSharp.TypeSpec declaringType, DynamicTypeReader dtype, Boolean
canImportBaseType) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.MetadataImporter.CreateType (System.Type type,
DynamicTypeReader dtype, Boolean canImportBaseType) [0x00000] in <filename
unknown>:0 
  at Mono.CSharp.MetadataImporter.ImportTypeBase (Mono.CSharp.TypeSpec spec,
System.Type type) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.MetadataImporter.ImportTypeBase (System.Type type) [0x00000]
in <filename unknown>:0 
  at Mono.CSharp.ImportedTypeDefinition.LoadMembers (Mono.CSharp.TypeSpec
declaringType, Boolean onlyTypes, Mono.CSharp.MemberCache& cache) [0x00000] in
<filename unknown>:0 
  at Mono.CSharp.TypeSpec.InitializeMemberCache (Boolean onlyTypes) [0x00000]
in <filename unknown>:0 
  at Mono.CSharp.TypeSpec.get_MemberCacheTypes () [0x00000] in <filename
unknown>:0 
  at Mono.CSharp.InflatedTypeSpec.InitializeMemberCache (Boolean onlyTypes)
[0x00000] in <filename unknown>:0 
  at Mono.CSharp.TypeSpec.get_MemberCacheTypes () [0x00000] in <filename
unknown>:0 
  at Mono.CSharp.MemberCache.FindNestedType (Mono.CSharp.TypeSpec container,
System.String name, Int32 arity) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.MetadataImporter.CreateType (System.Type type,
Mono.CSharp.TypeSpec declaringType, DynamicTypeReader dtype, Boolean
canImportBaseType) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.MetadataImporter.CreateType (System.Type type,
DynamicTypeReader dtype, Boolean canImportBaseType) [0x00000] in <filename
unknown>:0 
  at Mono.CSharp.MetadataImporter.ImportTypeBase (Mono.CSharp.TypeSpec spec,
System.Type type) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.MetadataImporter.ImportTypeBase (System.Type type) [0x00000]
in <filename unknown>:0 
  at Mono.CSharp.ImportedTypeDefinition.LoadMembers (Mono.CSharp.TypeSpec
declaringType, Boolean onlyTypes, Mono.CSharp.MemberCache& cache) [0x00000] in
<filename unknown>:0 
  at Mono.CSharp.TypeSpec.InitializeMemberCache (Boolean onlyTypes) [0x00000]
in <filename unknown>:0 
  at Mono.CSharp.TypeSpec.get_MemberCacheTypes () [0x00000] in <filename
unknown>:0 
  at Mono.CSharp.InflatedTypeSpec.InitializeMemberCache (Boolean onlyTypes)
[0x00000] in <filename unknown>:0 
  at Mono.CSharp.TypeSpec.get_MemberCacheTypes () [0x00000] in <filename
unknown>:0 
  at Mono.CSharp.MemberCache.FindNestedType (Mono.CSharp.TypeSpec container,
System.String name, Int32 arity) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.MemberAccess.ResolveNamespaceOrType (IMemberContext rc,
Boolean silent) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.MemberAccess.ResolveAsTypeStep (IMemberContext ec, Boolean
silent) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Expression.ResolveAsTypeTerminal (IMemberContext ec, Boolean
silent) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.TypeContainer.ResolveBaseTypes (Mono.CSharp.TypeExpr&
base_class) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Class.ResolveBaseTypes (Mono.CSharp.TypeExpr& base_class)
[0x00000] in <filename unknown>:0 
  at Mono.CSharp.TypeContainer.DefineBaseTypes () [0x00000] in <filename
unknown>:0 
  at Mono.CSharp.TypeContainer.DefineType () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.ModuleContainer.Define () [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 

[ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException: Object
reference not set to an instance of an object

 at Mono.CSharp.MetadataImporter.CreateType (System.Type type,
Mono.CSharp.TypeSpec declaringType, DynamicTypeReader dtype, Boolean
canImportBaseType) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.MetadataImporter.CreateType (System.Type type,
DynamicTypeReader dtype, Boolean canImportBaseType) [0x00000] in <filename
unknown>:0 
  at Mono.CSharp.MetadataImporter.ImportTypeBase (Mono.CSharp.TypeSpec spec,
System.Type type) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.MetadataImporter.ImportTypeBase (System.Type type) [0x00000]
in <filename unknown>:0 
  at Mono.CSharp.ImportedTypeDefinition.LoadMembers (Mono.CSharp.TypeSpec
declaringType, Boolean onlyTypes, Mono.CSharp.MemberCache& cache) [0x00000] in
<filename unknown>:0 
  at Mono.CSharp.TypeSpec.InitializeMemberCache (Boolean onlyTypes) [0x00000]
in <filename unknown>:0 
  at Mono.CSharp.TypeSpec.get_MemberCacheTypes () [0x00000] in <filename
unknown>:0 
  at Mono.CSharp.InflatedTypeSpec.InitializeMemberCache (Boolean onlyTypes)
[0x00000] in <filename unknown>:0 
  at Mono.CSharp.TypeSpec.get_MemberCacheTypes () [0x00000] in <filename
unknown>:0 
  at Mono.CSharp.MemberCache.FindNestedType (Mono.CSharp.TypeSpec container,
System.String name, Int32 arity) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.MetadataImporter.CreateType (System.Type type,
Mono.CSharp.TypeSpec declaringType, DynamicTypeReader dtype, Boolean
canImportBaseType) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.MetadataImporter.CreateType (System.Type type,
DynamicTypeReader dtype, Boolean canImportBaseType) [0x00000] in <filename
unknown>:0 
  at Mono.CSharp.MetadataImporter.ImportTypeBase (Mono.CSharp.TypeSpec spec,
System.Type type) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.MetadataImporter.ImportTypeBase (System.Type type) [0x00000]
in <filename unknown>:0 
  at Mono.CSharp.ImportedTypeDefinition.LoadMembers (Mono.CSharp.TypeSpec
declaringType, Boolean onlyTypes, Mono.CSharp.MemberCache& cache) [0x00000] in
<filename unknown>:0 
  at Mono.CSharp.TypeSpec.InitializeMemberCache (Boolean onlyTypes) [0x00000]
in <filename unknown>:0 
  at Mono.CSharp.TypeSpec.get_MemberCacheTypes () [0x00000] in <filename
unknown>:0 
  at Mono.CSharp.InflatedTypeSpec.InitializeMemberCache (Boolean onlyTypes)
[0x00000] in <filename unknown>:0 
  at Mono.CSharp.TypeSpec.get_MemberCacheTypes () [0x00000] in <filename
unknown>:0 
  at Mono.CSharp.MemberCache.FindNestedType (Mono.CSharp.TypeSpec container,
System.String name, Int32 arity) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.MemberAccess.ResolveNamespaceOrType (IMemberContext rc,
Boolean silent) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.MemberAccess.ResolveAsTypeStep (IMemberContext ec, Boolean
silent) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Expression.ResolveAsTypeTerminal (IMemberContext ec, Boolean
silent) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.TypeContainer.ResolveBaseTypes (Mono.CSharp.TypeExpr&
base_class) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Class.ResolveBaseTypes (Mono.CSharp.TypeExpr& base_class)
[0x00000] in <filename unknown>:0 
  at Mono.CSharp.TypeContainer.DefineBaseTypes () [0x00000] in <filename
unknown>:0 
  at Mono.CSharp.TypeContainer.DefineType () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.ModuleContainer.Define () [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 


Reproducible: Always

Steps to Reproduce:
I've been trying to get a simple example to crash, without success.  It seems
to involve referencing generics in multiple dlls, but beyond that I don't know.
Actual Results:  
Crash

Expected Results:  
Compile, or at least produce an error

Compilation was done through MonoDevelop for Unity.  Compile flags:  

C:\Program Files (x86)\Mono-2.10.8\bin\gmcs.bat 
 /noconfig
 /nologo
 /warn:4
 /debug:+
 /debug:full
 /optimize-
 /codepage:utf8
 /t:library

-- 
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