[Mono-bugs] [Bug 513013] New: LINQ query comprehension crash

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sat Jun 13 23:55:15 EDT 2009


http://bugzilla.novell.com/show_bug.cgi?id=513013


           Summary: LINQ query comprehension crash
    Classification: Mono
           Product: Mono: Compilers
           Version: 2.4.x
          Platform: x86-64
        OS/Version: Ubuntu
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: tmorris at tmorris.net
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.10)
Gecko/2009042513 Ubuntu/8.04 (hardy) Firefox/3.0.10

The following code will crash gmcs 2.4.0.0

using System;

public class M {
  class P<A> {
    public P<B> Select<B>(Func<A, B> f) { return null; }

    public P<B> SelectMany<B>(Func<A, P<B>> f) { return null; }

    public P<C> SelectMany<B, C>(Func<A, P<B>> f, Func<A, B, C> g) { return
null; }
  }

  public static void Main(string[] args) {
    P<int> a = null;
    P<int> b = null;
    P<int> c = null;

    P<int> t = a.SelectMany(aa => b.Select(bb => aa + bb));
    P<int> u = from aa in a 
               from bb in b 
               select aa + bb;

    P<int> v = from aa in a 
               from bb in b 
               from cc in c
               select aa + bb;

    // causes gmcs crash
    P<int> w = from aa in a 
               from bb in b 
               from cc in c
               select aa + bb + cc;

  }
}


Reproducible: Always

Steps to Reproduce:
1. Compile the given code with gmcs
Actual Results:  
Compiler crash

Exception caught by the compiler while compiling:
   Block that caused the problem begin at: M.cs(30,21):
                     Block being compiled: [M.cs(30,16):,Internal(1,1):]
System.Exception: Expression Mono.CSharp.ParameterReference did not set its
type after Resolve
called from: Mono.CSharp.ParameterReference
Exception caught by the compiler while compiling:
   Block that caused the problem begin at: M.cs(13,22):
                     Block being compiled: [M.cs(28,5):,M.cs(31,35):]
System.Exception: Expression Mono.CSharp.ParameterReference did not set its
type after Resolve
called from: Mono.CSharp.ParameterReference
Internal compiler error at M.cs(13,22):: exception caught while emitting
MethodBuilder [M::Main]

Unhandled Exception: System.Exception: Expression
Mono.CSharp.ParameterReference did not set its type after Resolve
called from: Mono.CSharp.ParameterReference
  at Mono.CSharp.Expression.Resolve (Mono.CSharp.EmitContext ec, ResolveFlags
flags) [0x00000]
  at Mono.CSharp.Expression.Resolve (Mono.CSharp.EmitContext ec) [0x00000]
  at Mono.CSharp.SimpleName.DoSimpleNameResolve (Mono.CSharp.EmitContext ec,
Mono.CSharp.Expression right_side, Boolean intermediate) [0x00000]
  at Mono.CSharp.SimpleName.SimpleNameResolve (Mono.CSharp.EmitContext ec,
Mono.CSharp.Expression right_side, Boolean intermediate) [0x00000]
  at Mono.CSharp.SimpleName.DoResolve (Mono.CSharp.EmitContext ec, Boolean
intermediate) [0x00000]
  at Mono.CSharp.Expression.Resolve (Mono.CSharp.EmitContext ec, ResolveFlags
flags) [0x00000]
  at Mono.CSharp.Expression.Resolve (Mono.CSharp.EmitContext ec) [0x00000]
  at Mono.CSharp.Binary.DoResolve (Mono.CSharp.EmitContext ec) [0x00000]
  at Mono.CSharp.Expression.Resolve (Mono.CSharp.EmitContext ec, ResolveFlags
flags) [0x00000]
  at Mono.CSharp.Expression.Resolve (Mono.CSharp.EmitContext ec) [0x00000]
  at Mono.CSharp.Return.DoResolve (Mono.CSharp.EmitContext ec) [0x00000]
  at Mono.CSharp.ContextualReturn.DoResolve (Mono.CSharp.EmitContext ec)
[0x00000]
  at Mono.CSharp.ExitStatement.Resolve (Mono.CSharp.EmitContext ec) [0x00000]
  at Mono.CSharp.Block.Resolve (Mono.CSharp.EmitContext ec) [0x00000]
  at Mono.CSharp.EmitContext.ResolveTopBlock (Mono.CSharp.EmitContext
anonymous_method_host, Mono.CSharp.ToplevelBlock block, Mono.CSharp.Parameters
ip, IMethodData md, System.Boolean& unreachable) [0x00000]
$ gmcs --version
Mono C# compiler version 2.4.0.0


Expected Results:  
Compiler succeeds or gives error message

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


More information about the mono-bugs mailing list