Bugzilla – Bug 321800
[GMCS] crash while checking constraints
Last modified: 2007-09-15 21:24:23 UTC
---- Reported by mike.allen@durrusa.com 2006-08-16 14:58:10 MST ---- Description of Problem: Get an unhandled System.NullReferenceException when compiling this simple example: test.cs: namespace Test { public class A <TA, TB> where TA: A <TA, TB> where TB: B <TA, TB> { } public class B <TA, TB> where TA: A <TA, TB> where TB: B <TA, TB> { } } Steps to reproduce the problem: 1. Compile using the command: gmcs -target:library -warn:4 -warnaserror test.cs 2. Er... 3. That's it! Actual Results: Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object in <0x00376> Mono.CSharp.ConstraintChecker:CheckConstraints (Mono.CSharp.EmitContext ec, Int32 index) in <0x00018> Mono.CSharp.ConstraintChecker:CheckConstraints (Mono.CSharp.EmitContext ec) in <0x00035> Mono.CSharp.ConstraintChecker:CheckConstraints (Mono.CSharp.EmitContext ec, System.Type gt, System.Type[] gen_params, System.Type[] atypes, Location loc) in <0x0001a> Mono.CSharp.ConstructedType:CheckConstraints (Mono.CSharp.EmitContext ec) in <0x0016c> Mono.CSharp.Expression:ResolveAsTypeTerminal (Mono.CSharp.EmitContext ec, Boolean silent) in <0x00010> Mono.CSharp.Expression:ResolveAsTypeTerminal (Mono.CSharp.EmitContext ec) in <0x0001c> Mono.CSharp.TypeExpr:ResolveType (Mono.CSharp.EmitContext ec) in <0x004af> Mono.CSharp.Constraints:ResolveTypes (Mono.CSharp.EmitContext ec) in <0x0001d> Mono.CSharp.TypeParameter:ResolveType (Mono.CSharp.EmitContext ec) in <0x0003f> Mono.CSharp.TypeParameter:DefineType (Mono.CSharp.EmitContext ec, System.Reflection.Emit.MethodBuilder builder, System.Reflection.MethodInfo implementing, Boolean is_override) in <0x00013> Mono.CSharp.TypeParameter:DefineType (Mono.CSharp.EmitContext ec) in <0x002cc> Mono.CSharp.TypeContainer:ResolveType () in <0x000d3> Mono.CSharp.RootContext:PopulateTypes () in <0x009b1> Mono.CSharp.Driver:MainDriver (System.String[] args) in <0x00051> Mono.CSharp.Driver:Main (System.String[] args) Expected Results: Clean compile with no errors. How often does this happen? Every time. Additional Information: Compiles clean using Microsoft C# compiler with same options. ---- Additional Comments From martin@ximian.com 2006-10-09 09:12:18 MST ---- I can't reproduce this. ---- Additional Comments From mike.allen@durrusa.com 2006-10-09 10:11:33 MST ---- Did you use the same GMCS version (1.1.13.6) I did? If not, which version did you use? This bug is a showstopper for me right now, so if you have a version that works, I'll use it. ---- Additional Comments From mike.allen@durrusa.com 2006-10-27 17:26:32 MST ---- Since the Mono team have been a little, er, slow, replying to my previous question, here's some follow up: The test program compiles clean with gmcs version 1.1.17.1 (available with Ubuntu 6.10 for those who are interested). Unknown bug field "cf_op_sys_details" encountered while moving bug <cf_op_sys_details>Ububtu 6.06</cf_op_sys_details> Unknown bug field "cf_version_details" encountered while moving bug <cf_version_details>1.1.13.6-0ubuntu3</cf_version_details> Unknown operating system unknown. Setting to default OS "Other".