[Mono-bugs] [Bug 388977] New: generic_params table error when compiling code that references an assembly with generics

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri May 9 15:39:56 EDT 2008


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


           Summary: generic_params table error when compiling code that
                    references an assembly with generics
           Product: Mono: Compilers
           Version: 1.9.0
          Platform: x86
        OS/Version: RHEL 5
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: tcannon at vmware.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: Customer


I have two assemblies: the first contains a interface with generics, and the
second assembly refers to the first assembly.  The first assembly compiles
without error in mdtool.  When I compile the second, I get this error.  Code
snippets from both assemblies are pasted below the output.

bash-3.1$ mdtool build --f:test.mdp
MonoDevelop Build Tool
Loading project: test.mdp
   Building Project: test (Debug)
      Performing main compilation...


      ** ERROR **: Signature claims method has generic parameters, but
      generic_params table says it doesn't
      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_DeclaringType () <0x00025>
        at Mono.CSharp.TypeManager.IsGenericMethodDefinition
      (System.Reflection.MethodBase) <0x00011>
        at Mono.CSharp.TypeManager.GetMethodName (System.Reflection.MethodInfo)
      <0x00010>
        at Mono.CSharp.MemberCache.AddMembers
     
(System.Reflection.MemberTypes,System.Reflection.BindingFlags,Mono.CSharp.
      IMemberContainer) <0x000e0>
        at Mono.CSharp.MemberCache.AddMembers
      (System.Reflection.MemberTypes,Mono.CSharp.IMemberContainer) <0x00032>
        at Mono.CSharp.MemberCache.AddMembers (Mono.CSharp.IMemberContainer)
      <0x00044>
        at Mono.CSharp.MemberCache..ctor (Mono.CSharp.IMemberContainer)
      <0x0017e>
        at Mono.CSharp.TypeHandle..ctor (System.Type) <0x00150>
        at Mono.CSharp.TypeHandle.GetTypeHandle (System.Type) <0x0004e>
        at Mono.CSharp.TypeHandle.GetMemberCache (System.Type) <0x0000b>
        at Mono.CSharp.TypeManager.MemberLookup_FindMembers
     
(System.Type,System.Reflection.MemberTypes,System.Reflection.BindingFlags,
      string,bool&) <0x00232>
        at Mono.CSharp.TypeManager.RealMemberLookup
     
(System.Type,System.Type,System.Type,System.Reflection.MemberTypes,System.
      Reflection.BindingFlags,string,System.Collections.IList) <0x00152>
        at Mono.CSharp.TypeManager.MemberLookup
     
(System.Type,System.Type,System.Type,System.Reflection.MemberTypes,System.
      Reflection.BindingFlags,string,System.Collections.IList) <0x0001f>
        at Mono.CSharp.Expression.MemberLookup
     
(System.Type,System.Type,System.Type,string,System.Reflection.MemberTypes,
      System.Reflection.BindingFlags,Mono.CSharp.Location) <0x00042>
        at Mono.CSharp.Expression.MemberLookup
      (System.Type,System.Type,System.Type,string,Mono.CSharp.Location)
      <0x0001d>
        at Mono.CSharp.MemberAccess.DoResolve
      (Mono.CSharp.EmitContext,Mono.CSharp.Expression) <0x002b4>
        at Mono.CSharp.MemberAccess.DoResolve (Mono.CSharp.EmitContext)
      <0x0000f>
        at Mono.CSharp.Expression.Resolve
      (Mono.CSharp.EmitContext,Mono.CSharp.ResolveFlags) <0x00134>
        at Mono.CSharp.Invocation.DoResolve (Mono.CSharp.EmitContext) <0x0002b>
        at Mono.CSharp.Expression.Resolve
      (Mono.CSharp.EmitContext,Mono.CSharp.ResolveFlags) <0x00134>
        at Mono.CSharp.Expression.Resolve (Mono.CSharp.EmitContext) <0x00012>
        at Mono.CSharp.ExpressionStatement.ResolveStatement
      (Mono.CSharp.EmitContext) <0x00014>
        at Mono.CSharp.StatementExpression.Resolve (Mono.CSharp.EmitContext)
      <0x00022>
        at Mono.CSharp.Block.Resolve (Mono.CSharp.EmitContext) <0x001e1>
        at Mono.CSharp.EmitContext.ResolveTopBlock
     
(Mono.CSharp.EmitContext,Mono.CSharp.ToplevelBlock,Mono.CSharp.Parameters,
      Mono.CSharp.IMethodData,bool&) <0x0019d>
        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 [0x817ed0f]
        [0xb7fd6440]
        /lib/libc.so.6(abort+0x101) [0x5fc451]
        /lib/libglib-2.0.so.0(g_logv+0x4d2) [0x8e1c92]
        /lib/libglib-2.0.so.0(g_log+0x29) [0x8e1cc9]
        /usr/bin/mono(mono_method_signature+0x144) [0x80e56b4]
        /usr/bin/mono [0x80f481f]
        [0xb711c3f9]
        [0xb711c3b6]
        [0xb710c022]
        [0xb710bf91]
        [0xb710b1c9]
        [0xb710b0cb]
        [0xb710b025]
        [0xb710a667]
        [0xb710a411]
        [0xb710a27f]
        [0xb710a1ac]
        [0xb70dec2b]
        [0xb70de153]
        [0xb70fdc98]
        [0xb70fd52b]
        [0xb70edf4e]
        [0xb70ece95]
        [0xb70ecbc8]
        [0xb70ea04d]
        [0xb70ec744]
        [0xb70ea04d]
        [0xb70e9ea3]
        [0xb70e9e4d]
        [0xb70e9e13]
        [0xb70e22fa]
        [0xb70e1d1e]
        [0xb70e93d8]
        [0xb70e8c15]
        [0xb70e89ee]
        [0xb70f8ed2]
        [0xb70f8887]
        [0xb7b26a53]
        [0xb7b2562e]
        [0xb7b211c4]
        /usr/bin/mono(mono_runtime_exec_main+0x10e) [0x80eeeae]
        /usr/bin/mono(mono_runtime_run_main+0x1ba) [0x80f026a]
        /usr/bin/mono(mono_main+0xff1) [0x8059431]
        /usr/bin/mono [0x8057f32]
        /lib/libc.so.6(__libc_start_main+0xdc) [0x5e7dec]
        /usr/bin/mono [0x8057e51]

      Debug info from gdb:

      (no debugging symbols found)
      Using host libthread_db library "/lib/libthread_db.so.1".
      (no debugging symbols found)
      (no debugging symbols found)
      (no debugging symbols found)
      (no debugging symbols found)
      [Thread debugging using libthread_db enabled]
      [New Thread -1208198544 (LWP 5613)]
      [New Thread -1218618480 (LWP 5618)]
      [New Thread -1208136816 (LWP 5617)]
      (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)
      0xb7fd6402 in __kernel_vsyscall ()
        3 Thread -1208136816 (LWP 5617)  0xb7fd6402 in __kernel_vsyscall ()
        2 Thread -1218618480 (LWP 5618)  0xb7fd6402 in __kernel_vsyscall ()
        1 Thread -1208198544 (LWP 5613)  0xb7fd6402 in __kernel_vsyscall ()

      Thread 3 (Thread -1208136816 (LWP 5617)):
      #0  0xb7fd6402 in __kernel_vsyscall ()
      #1  0x0074c506 in __nanosleep_nocancel () from /lib/libpthread.so.0
      #2  0x081184c1 in mono_once ()
      #3  0x007452db in start_thread () from /lib/libpthread.so.0
      #4  0x0069f14e in clone () from /lib/libc.so.6

      Thread 2 (Thread -1218618480 (LWP 5618)):
      #0  0xb7fd6402 in __kernel_vsyscall ()
      #1  0x00749146 in pthread_cond_wait@@GLIBC_2.3.2 () from
      /lib/libpthread.so.0
      #2  0x08123cbf in mono_pthread_key_for_tls ()
      #3  0xb7acf1c4 in ?? ()
      #4  0x080c6cd3 in mono_thread_exit ()
      #5  0x00000003 in ?? ()

      Thread 1 (Thread -1208198544 (LWP 5613)):
      #0  0xb7fd6402 in __kernel_vsyscall ()
      #1  0x00697fb1 in ___newselect_nocancel () from /lib/libc.so.6
      #2  0x009049be in g_spawn_sync () from /lib/libglib-2.0.so.0
      #3  0x00904d8c in g_spawn_command_line_sync () from /lib/libglib-2.0.so.0
      #4  0x0817eda1 in mono_print_thread_dump ()
      #5  <signal handler called>
      #6  0xb7fd6402 in __kernel_vsyscall ()
      #7  0x005fac00 in raise () from /lib/libc.so.6
      #8  0x005fc451 in abort () from /lib/libc.so.6
      #9  0x008e1c92 in g_logv () from /lib/libglib-2.0.so.0
      #10 0x008e1cc9 in g_log () from /lib/libglib-2.0.so.0
      #11 0x080e56b4 in mono_method_signature ()
      #12 0x080f481f in mono_add_internal_call ()
      #13 0xb711c3f9 in ?? ()
      #14 0x0a44ec8c in ?? ()
      #15 0xbfcf4a08 in ?? ()
      #16 0x0a058af0 in ?? ()
      #17 0x00000000 in ?? ()
      #0  0xb7fd6402 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.
      =================================================================



      Build complete -- 1 error, 0 warnings


Here is the interface from the first assembly that seems to be causing the 
problem.  This is just one of many classes in the assembly.  I tried creating
a new assembly with just this interface but couldn't reproduce the problem.
My company's legal policies prevent me from including the full source of the
assembly in this bug report.

using System;
using System.Collections.Generic;
using System.Text;

namespace VirtualInfrastructure {
   public interface ManagedObjectLookup {

      Type GetObject<Type>(string id) where Type : ManagedObject;

      ManagedObject this[string fullId] { get; }
   }
}

Here is the full source to the assembly that causes the error.  As you
can see, it includes a reference to "VirtualInfrastructure" the assembly
that contains the interface posted above.

using System;
using VirtualInfrastructure;

namespace InterfaceTest {
   class MainClass {
      public static void Main (string[] args) {
         ManagedObjectLookup lookup = null;

         //this can be any method on ManagedObjectLookup
         //whatsoever, base-class or derived class.
         lookup.ToString();
      }
   }
}


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