[Mono-bugs] [Bug 461198] New: [Regression] Still some corlib trouble with thrown/ catched exception and genrics

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sat Dec 20 10:56:10 EST 2008


           Summary: [Regression] Still some corlib trouble with
                    thrown/catched exception and genrics
           Product: Mono: Runtime
           Version: SVN
          Platform: x86-64
        OS/Version: Linux
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: generics
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: mono at e-tobi.net
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---

It's basically the same regression as already found and fixed in:


Running the following code throws a runtime error (see below). Running it with
MONO_GENERIC_SHARING=corlib works fine.

I found this problem while trying to use StructureMap with Mono.

using System;

namespace TestCase
    class Program
        public static void Main()
            new Foo<string>().DoSomething();

    public class Foo<T> : Bar<Foo<T>> 

    public class Bar<T> : Baz
        protected override void DoSomethingElse()
                throw new Exception();

    public abstract class Baz
        protected abstract void DoSomethingElse();

        public virtual void DoSomething()

The runtime error:

[mono-trunk] /tmp/testcase/testcase/bin/Debug @ mono ./testcase.exe
** ERROR:(mini-exceptions.c:768):get_exception_catch_class: assertion failed:
(class->generic_class->container_class == method_container_class)

Native stacktrace:

        mono [0x47dc00]
        /lib/libpthread.so.0 [0x7fd3e28bea80]
        /lib/libc.so.6(gsignal+0x35) [0x7fd3e230bed5]
        /lib/libc.so.6(abort+0x183) [0x7fd3e230d3f3]
        /usr/lib/libglib-2.0.so.0(g_assertion_message+0x104) [0x7fd3e2f37fe4]
        /usr/lib/libglib-2.0.so.0 [0x7fd3e2f38482]
        mono [0x47d067]
        mono [0x47cc35]
        mono(mono_amd64_throw_exception+0x139) [0x4aeaf9]

Debug info from gdb:

[Thread debugging using libthread_db enabled]
[New Thread 0x7fd3e3597720 (LWP 22056)]
[New Thread 0x412ac950 (LWP 22058)]
[New Thread 0x40ea8950 (LWP 22057)]
0x00007fd3e23a6269 in syscall () from /lib/libc.so.6
  3 Thread 0x40ea8950 (LWP 22057)  0x00007fd3e28be0e1 in nanosleep () from
  2 Thread 0x412ac950 (LWP 22058)  0x00007fd3e28bcbd1 in sem_wait () from
  1 Thread 0x7fd3e3597720 (LWP 22056)  0x00007fd3e23a6269 in syscall () from

Thread 3 (Thread 0x40ea8950 (LWP 22057)):
#0  0x00007fd3e28be0e1 in nanosleep () from /lib/libpthread.so.0
#1  0x00000000005568c2 in collection_thread (unused=<value optimized out>) at
#2  0x00007fd3e28b6fc7 in start_thread () from /lib/libpthread.so.0
#3  0x00007fd3e23a95ad in clone () from /lib/libc.so.6
#4  0x0000000000000000 in ?? ()

Thread 2 (Thread 0x412ac950 (LWP 22058)):
#0  0x00007fd3e28bcbd1 in sem_wait () from /lib/libpthread.so.0
#1  0x000000000052727a in finalizer_thread (unused=<value optimized out>) at
#2  0x0000000000510803 in start_wrapper (data=<value optimized out>) at
#3  0x00000000005589fb in thread_start_routine (args=0x14f0668) at
#4  0x000000000056ebd2 in GC_start_routine (arg=0x7fd3e3442e70) at
#5  0x00007fd3e28b6fc7 in start_thread () from /lib/libpthread.so.0
#6  0x00007fd3e23a95ad in clone () from /lib/libc.so.6
#7  0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7fd3e3597720 (LWP 22056)):
#0  0x00007fd3e23a6269 in syscall () from /lib/libc.so.6
#1  0x000000000047dd02 in mono_handle_native_sigsegv (signal=10, ctx=<value
optimized out>) at mini-exceptions.c:1406
#2  <signal handler called>
#3  0x00007fd3e230bed5 in raise () from /lib/libc.so.6
#4  0x00007fd3e230d3f3 in abort () from /lib/libc.so.6
#5  0x00007fd3e2f37fe4 in g_assertion_message () from /usr/lib/libglib-2.0.so.0
#6  0x00007fd3e2f38482 in g_assertion_message_expr () from
#7  0x000000000047d067 in mono_handle_exception_internal (ctx=0x7fffeb5ba310,
obj=0x7fd3e11d1de0, original_ip=<value optimized out>, test_only=1,
    at mini-exceptions.c:768
#8  0x000000000047cc35 in mono_handle_exception_internal (ctx=0x7fffeb5ba400,
obj=0x7fd3e11d1de0, original_ip=0x40e954d0, test_only=0, out_filter_idx=0x0) at
#9  0x00000000004aeaf9 in mono_amd64_throw_exception (dummy1=<value optimized
out>, dummy2=<value optimized out>, dummy3=<value optimized out>, dummy4=<value
optimized out>, 
    dummy5=<value optimized out>, dummy6=<value optimized out>,
exc=0x7fd3e11d1de0, rip=1089033424, rsp=140737142039840, rbx=0,
rbp=140737142039888, r12=21751376, r13=0, 
    r14=140548027718656, r15=140547991638000, rdi=140547991608800, rsi=0,
rax=140547991608800, rcx=1089033712, rdx=0, rethrow=0) at
#10 0x0000000040330b36 in ?? ()
#11 0x00007fd3e11d1de0 in ?? ()
#12 0x0000000040e954d0 in ?? ()
#13 0x00007fffeb5ba520 in ?? ()
#14 0x0000000000000000 in ?? ()
#0  0x00007fd3e23a6269 in syscall () from /lib/libc.so.6

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.

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