Bug 1388 - C# compiler crash w/generics
Summary: C# compiler crash w/generics
Status: RESOLVED FIXED
Alias: None
Product: Compilers
Classification: Mono
Component: C# ()
Version: unspecified
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2011-10-10 01:28 UTC by Brian Luczkiewicz
Modified: 2011-10-11 07:08 UTC (History)
1 user (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
compile this with dmcs to reproduce the bug (570 bytes, application/octet-stream)
2011-10-10 01:28 UTC, Brian Luczkiewicz
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Brian Luczkiewicz 2011-10-10 01:28:46 UTC
Created attachment 655 [details]
compile this with dmcs to reproduce the bug

To reproduce:

1. download the attached file and name it 't.cs'
2. run 'dmcs t.cs' to compile it

Expected result: 

program compiles or reports program errors and exits.

Actual result:

compiler crashes:

$ dmcs t.cs
Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object
  at Mono.CSharp.TypeParameterInflator.Inflate (Mono.CSharp.TypeSpec type) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.InflatedTypeSpec.InitializeMemberCache (Boolean onlyTypes) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.InflatedTypeSpec.get_BaseType () [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.TypeArguments.Resolve (IMemberContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.GenericTypeExpr.DoResolveAsTypeStep (IMemberContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.TypeExpr.ResolveAsTypeStep (IMemberContext ec, Boolean silent) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.SimpleName.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.TypeParameterInflator.Inflate (Mono.CSharp.TypeSpec type) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.InflatedTypeSpec.InitializeMemberCache (Boolean onlyTypes) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.InflatedTypeSpec.get_BaseType () [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.TypeArguments.Resolve (IMemberContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.GenericTypeExpr.DoResolveAsTypeStep (IMemberContext ec) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.TypeExpr.ResolveAsTypeStep (IMemberContext ec, Boolean silent) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.SimpleName.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
Comment 1 Brian Luczkiewicz 2011-10-10 01:29:22 UTC
The version picker on bugzilla seems to be broken since all it will let me pick is "unspecified".

I have reproduced this with mono 2.10.5.
Comment 2 Marek Safar 2011-10-11 07:08:53 UTC
Fixed in master