[Mono-bugs] [Bug 430450] New: ** ERROR **: MVAR 2 (S) cannot be expanded in this context with 2 instantiations

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sat Sep 27 18:12:17 EDT 2008


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


           Summary: ** ERROR **: MVAR 2 (S) cannot be expanded in this
                    context with 2 instantiations
           Product: Mono: Compilers
           Version: 1.9
          Platform: Other
        OS/Version: Ubuntu
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: mhbouhmadi at free.fr
         QAContact: mono-bugs at lists.ximian.com
          Found By: Other


Created an attachment (id=242108)
 --> (https://bugzilla.novell.com/attachment.cgi?id=242108)
the source code

Hi,
The version of mcs is 1.9.1 I run it within Monodevelop 1.0.
I get the problem with the runtime "Mono/.Net 2.0 Profile" and
"Moonlight/Silverlight 1.1"

I am trying to write a state monad in c#. so basically many heavy lambda and
many generics.
My code does not compile and it seems as if the compiler mismatched some
generics types...
In order to report a bug, I begin simplifying my code but I got a worst
problem: the mcs aborting! You'll get the whole output messages in the end of
this post.

Here is the code. I commented my original state monad code: I think the
genercis type argument error is related to the crash. So it may help.


//************************************************************************
using System;

namespace System
{
        public delegate TR Func<T,TR>(T _t);
}
namespace testmcs
{

#if true
        class SimplifiedStateMonadTest
        {
                //State monad
                public class M_State<X,S>
                {

                        public M_State(X _t) {}
                        public X x;
                }

                public static Func<M_State<X,S>, M_State<Y,S>>
map<X,Y,S>(Func<X,Y> _f)
                {
                        return (M_State<X,S> x_) => 
                                new M_State<Y,S>(_f(x_.x));
                }
        }
#endif
//#if false
//      //Tupple
//      public class T<T1, T2> 
//      {
//              public readonly T1 _1; 
//              public readonly T2 _2; 
//              public T(T1 __1, T2 __2) { _1 = __1; _2 = __2; } 
//      }
//
//      class StateMonadTest
//      {
//              //State monad
//              public class M_State<X,S>
//              {
//                      
//                      public M_State(Func<S, T<X,S>> _state_transformer) {
state_transformer = _state_transformer; }
//                      public readonly Func<S, T<X,S>> state_transformer;
//              }
//
//              public static Func<M_State<X,S>, M_State<Y,S>>
map<X,Y,S>(Func<X,Y> _f)
//              {
//                      return (M_State<X,S> x_) => 
//                              new M_State<Y,S>((S s) =>
//                                               {
//                                      T<X,S> st = x_.state_transformer(s);
//                                      return new T(_f(st._1), st._2);
//                              });
//              }
//      }
//#endif

        class MainClass
        {
                public static void Main(string[] args)
                {
                        Console.WriteLine("Hello World!");
                }
        }
}
//**********************************************************************
Here is the output
** ERROR **: MVAR 2 (S) cannot be expanded in this context with 2
instantiations
aborting...
Stacktrace:

  at (wrapper managed-to-native)
System.Reflection.MonoMethodInfo.get_method_info
(intptr,System.Reflection.MonoMethodInfo&) <0x00004>
  at (wrapper managed-to-native)
System.Reflection.MonoMethodInfo.get_method_info
(intptr,System.Reflection.MonoMethodInfo&) <0xffffffff>
  at System.Reflection.MonoMethod.get_Attributes () <0x00025>
  at System.Reflection.MonoGenericClass.GetMethods_impl
(System.Reflection.BindingFlags,System.Type) <0x0009a>
  at System.Reflection.MonoGenericClass.GetMethods
(System.Reflection.BindingFlags) <0x00077>
  at System.Type.FindMembers
(System.Reflection.MemberTypes,System.Reflection.BindingFlags,System.Reflection.MemberFilter,object)
<0x00291>
  at Mono.CSharp.TypeManager.FindMembers
(System.Type,System.Reflection.MemberTypes,System.Reflection.BindingFlags,System.Reflection.MemberFilter,object)
<0x002f7>
  at Mono.CSharp.TypeContainer.Mono.CSharp.IMemberContainer.GetMembers
(System.Reflection.MemberTypes,System.Reflection.BindingFlags) <0x0002f>
  at Mono.CSharp.MemberCache.AddMembers
(System.Reflection.MemberTypes,System.Reflection.BindingFlags,Mono.CSharp.IMemberContainer)
<0x0002a>
  at Mono.CSharp.MemberCache.AddMembers
(System.Reflection.MemberTypes,Mono.CSharp.IMemberContainer) <0x00018>
  at Mono.CSharp.MemberCache.AddMembers (Mono.CSharp.IMemberContainer)
<0x00044>
  at Mono.CSharp.MemberCache..ctor (Mono.CSharp.IMemberContainer) <0x0017e>
  at Mono.CSharp.TypeContainer.DoDefineMembers () <0x00825>
  at Mono.CSharp.Class.DoDefineMembers () <0x00060>
  at Mono.CSharp.CompilerGeneratedClass.DoDefineMembers () <0x0001f>
  at Mono.CSharp.ScopeInfo.DoDefineMembers () <0x0006f>
  at Mono.CSharp.RootScopeInfo.DoDefineMembers () <0x00301>
  at Mono.CSharp.TypeContainer.DefineMembers () <0x00047>
  at Mono.CSharp.ToplevelBlock.CompleteContexts (Mono.CSharp.EmitContext)
<0x0009c>
  at Mono.CSharp.EmitContext.ResolveTopBlock
(Mono.CSharp.EmitContext,Mono.CSharp.ToplevelBlock,Mono.CSharp.Parameters,Mono.CSharp.IMethodData,bool&)
<0x003d0>
  at Mono.CSharp.EmitContext.EmitTopBlock
(Mono.CSharp.IMethodData,Mono.CSharp.ToplevelBlock) <0x00047>
  at Mono.CSharp.MethodData.Emit (Mono.CSharp.DeclSpace) <0x0014c>
  at Mono.CSharp.Method.Emit () <0x000a5>
  at Mono.CSharp.TypeContainer.EmitType () <0x00261>
  at Mono.CSharp.RootContext.EmitCode () <0x0007e>
  at Mono.CSharp.Driver.MainDriver (string[]) <0x009fa>
  at Mono.CSharp.Driver.Main (string[]) <0x00055>
  at (wrapper runtime-invoke) Mono.CSharp.Driver.runtime_invoke_int_string[]
(object,intptr,intptr,intptr) <0xffffffff>

Native stacktrace:

        /usr/bin/mono [0x8172aba]
        [0xb7efc440]
        /lib/tls/i686/cmov/libc.so.6(abort+0x101) [0xb7cc8a01]
        /usr/lib/libglib-2.0.so.0(g_logv+0x46a) [0xb7e6e1fa]
        /usr/lib/libglib-2.0.so.0(g_log+0x29) [0xb7e6e239]
        /usr/bin/mono [0x80aff7d]
        /usr/bin/mono(mono_class_inflate_generic_type+0x14) [0x80b1254]
        /usr/bin/mono [0x809c7c5]
        /usr/bin/mono [0x80b0125]
        /usr/bin/mono(mono_class_inflate_generic_type+0x14) [0x80b1254]
        /usr/bin/mono [0x80e48e2]
        /usr/bin/mono(mono_method_signature+0x16b) [0x80e4e0b]
        /usr/bin/mono [0x817dcef]
        [0xb6e0d1e9]
        [0xb6e126c6]
        [0xb6e0b453]
        [0xb6e0b288]
        [0xb6e018aa]
        [0xb6e09cd8]
        [0xb6e099b0]
        [0xb6e012a3]
        [0xb6e01241]
        [0xb6e011b5]
        [0xb6e0080f]
        [0xb6e00116]
        [0xb6dff719]
        [0xb6dcccf8]
        [0xb6dcc9d0]
        [0xb6dcc922]
        [0xb6dff618]
        [0xb6dfbe1d]
        [0xb6dfab71]
        [0xb6de1d00]
        [0xb6de1805]
        [0xb6de15de]
        [0xb6df27f2]
        [0xb6df21a7]
        [0xb7839a6b]
        [0xb7838646]
        [0xb78341c4]
        /usr/bin/mono(mono_runtime_exec_main+0x10e) [0x80a853e]
        /usr/bin/mono(mono_runtime_run_main+0x173) [0x80a87e3]
        /usr/bin/mono(mono_main+0x6a9) [0x805af19]
        /usr/bin/mono [0x805a362]
        /lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe0) [0xb7cb2450]
        /usr/bin/mono [0x805a2d1]

Debug info from gdb:

(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
[Thread debugging using libthread_db enabled]
[New Thread 0xb7c5a720 (LWP 8322)]
[New Thread 0xb72e8b90 (LWP 8327)]
[New Thread 0xb7887b90 (LWP 8326)]
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
0xb7efc410 in __kernel_vsyscall ()
  3 Thread 0xb7887b90 (LWP 8326)  0xb7efc410 in __kernel_vsyscall ()
  2 Thread 0xb72e8b90 (LWP 8327)  0xb7efc410 in __kernel_vsyscall ()
  1 Thread 0xb7c5a720 (LWP 8322)  0xb7efc410 in __kernel_vsyscall ()

Thread 3 (Thread 0xb7887b90 (LWP 8326)):
#0  0xb7efc410 in __kernel_vsyscall ()
#1  0xb7e1e196 in nanosleep () from /lib/tls/i686/cmov/libpthread.so.0
#2  0x08118c41 in ?? ()
#3  0xb7e164fb in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#4  0xb7d72e5e in clone () from /lib/tls/i686/cmov/libc.so.6

Thread 2 (Thread 0xb72e8b90 (LWP 8327)):
#0  0xb7efc410 in __kernel_vsyscall ()
#1  0xb7e1aaa5 in pthread_cond_wait@@GLIBC_2.3.2 ()
   from /lib/tls/i686/cmov/libpthread.so.0
#2  0x0810e3df in ?? ()
#3  0x08110ead in ?? ()
#4  0x08110f1c in ?? ()
#5  0x0810a00a in ?? ()
#6  0x080d54aa in ?? ()
#7  0x080ebedf in ?? ()
#8  0x08117302 in ?? ()
#9  0x08128605 in ?? ()
#10 0xb7e164fb in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#11 0xb7d72e5e in clone () from /lib/tls/i686/cmov/libc.so.6

Thread 1 (Thread 0xb7c5a720 (LWP 8322)):
#0  0xb7efc410 in __kernel_vsyscall ()
#1  0xb7d31d89 in fork () from /lib/tls/i686/cmov/libc.so.6
#2  0xb7e20034 in fork () from /lib/tls/i686/cmov/libpthread.so.0
#3  0xb7e9a589 in ?? () from /usr/lib/libglib-2.0.so.0
#4  0xb7e9b1ad in g_spawn_sync () from /usr/lib/libglib-2.0.so.0
#5  0xb7e9b66c in g_spawn_command_line_sync () from /usr/lib/libglib-2.0.so0
#6  0x08172b55 in ?? ()
#7  <signal handler called>
#8  0xb7efc410 in __kernel_vsyscall ()
#9  0xb7cc7085 in raise () from /lib/tls/i686/cmov/libc.so.6
#10 0xb7cc8a01 in abort () from /lib/tls/i686/cmov/libc.so.6
#11 0xb7e6e1fa in g_logv () from /usr/lib/libglib-2.0.so.0
#12 0xb7e6e239 in g_log () from /usr/lib/libglib-2.0.so.0
#13 0x080aff7d in ?? ()
#14 0x080b1254 in mono_class_inflate_generic_type ()
#15 0x0809c7c5 in ?? ()
#16 0x080b0125 in ?? ()
#17 0x080b1254 in mono_class_inflate_generic_type ()
#18 0x080e48e2 in ?? ()
#19 0x080e4e0b in mono_method_signature ()
#20 0x0817dcef in ?? ()
#21 0xb6e0d1e9 in ?? ()
#22 0xb6e126c6 in ?? ()
#23 0xb6e0b453 in ?? ()
#24 0xb6e0b288 in ?? ()
#25 0xb6e018aa in ?? ()
#26 0xb6e09cd8 in ?? ()
#27 0xb6e099b0 in ?? ()
#28 0xb6e012a3 in ?? ()
#29 0xb6e01241 in ?? ()
#30 0xb6e011b5 in ?? ()
#31 0xb6e0080f in ?? ()
#32 0xb6e00116 in ?? ()
#33 0xb6dff719 in ?? ()
#34 0xb6dcccf8 in ?? ()
#35 0xb6dcc9d0 in ?? ()
#36 0xb6dcc922 in ?? ()
#37 0xb6dff618 in ?? ()
#38 0xb6dfbe1d in ?? ()
#39 0xb6dfab71 in ?? ()
#40 0xb6de1d00 in ?? ()
#41 0xb6de1805 in ?? ()
#42 0xb6de15de in ?? ()
#43 0xb6df27f2 in ?? ()
#44 0xb6df21a7 in ?? ()
#45 0xb7839a6b in ?? ()
#46 0xb7838646 in ?? ()
#47 0xb78341c4 in ?? ()
#48 0x080a853e in mono_runtime_exec_main ()
#49 0x080a87e3 in mono_runtime_run_main ()
#50 0x0805af19 in mono_main ()
#51 0x0805a362 in ?? ()
#52 0xb7cb2450 in __libc_start_main () from /lib/tls/i686/cmov/libc.so.6
#53 0x0805a2d1 in ?? ()
#0  0xb7efc410 in __kernel_vsyscall ()


=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================



Compilation Terminée -- 1 Erreur, 0 Avertissement

---------------------- Fini ----------------------

Compilation : 1 Erreur, 0 Avertissement


-- 
Configure bugmail: https://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