[Mono-bugs] [Bug 569390] New: SIGSEGV Error with MarshalByRefObject implementing a generic interface

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Jan 8 16:31:45 EST 2010


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

http://bugzilla.novell.com/show_bug.cgi?id=569390#c0


           Summary: SIGSEGV Error with MarshalByRefObject implementing a
                    generic interface
    Classification: Mono
           Product: Mono: Runtime
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: JIT
        AssignedTo: lupus at novell.com
        ReportedBy: miguel at novell.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


The following sample crashes Mono:


using System;
//using NUnit.Framework;

namespace Limaki.Tests.MonoGenericError2
{
    //[TestFixture]
    public class GenericErrorTest
    {

        public static void Main (string[] args)
        {
            var test = new GenericErrorTest ();
            test.Test1 ();
            Console.WriteLine ("Test1 passed");

            test = new GenericErrorTest ();
            test.Test2 ();
            Console.WriteLine ("Test2 passed");

            Console.WriteLine ("ErrorFree!");
        }

        //[Test]
        public void Test1 ()
        {
            var display = new DisplayDevice<object> ();
            display.Error1 ();
        }

        //[Test]
        public void Test2 ()
        {
            var display = new DisplayDevice<object> ();
            display.Error2 ();
        }

    }

    public interface IDisplayDevice<T>
    {
        Display<T> Display { get; set; }
    }

    public class DisplayDevice<T> : MarshalByRefObject, IDisplayDevice<T>
    {
        public Display<T> Display { get; set; }

        public void Error1 ()
        {

            var deviceInstrumenter = new DeviceInstrumenter<T> ();
            deviceInstrumenter.Device = this;

            var display = new Display<T> ();


            deviceInstrumenter.Factor (display);
        }

        public void Error2 ()
        {
            var display = new Display<T> ();
            this.Display = display;
        }
    }

    public class Display<T>
    {
        public T Data { get; set; }
    }

    public class DeviceInstrumenter<T>
    {
        public virtual DisplayDevice<T> Device { get; set; }
        public virtual void Factor (Display<T> display)
        {
            Device.Display = display;
        }
    }
}

The crash is:

**
** ERROR:(method-to-ir.c:5466):mono_method_to_ir: assertion failed:
(!sig->has_type_parameters)
Stacktrace:

  at Limaki.Tests.MonoGenericError2.DeviceInstrumenter`1<object>.Factor
(Limaki.Tests.MonoGenericError2.Display`1<object>) <0xffffffff>
  at Limaki.Tests.MonoGenericError2.DeviceInstrumenter`1<object>.Factor
(Limaki.Tests.MonoGenericError2.Display`1<object>) <0x00026>
  at Limaki.Tests.MonoGenericError2.DisplayDevice`1<object>.Error1 () <0x00089>
  at (wrapper remoting-invoke-with-check)
Limaki.Tests.MonoGenericError2.DisplayDevice`1<object>.Error1 () <0x00053>
  at Limaki.Tests.MonoGenericError2.GenericErrorTest.Test1 () <0x00034>
  at Limaki.Tests.MonoGenericError2.GenericErrorTest.Main (string[]) <0x00020>
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object
(object,intptr,intptr,intptr) <0x00043>

Native stacktrace:

    mono [0x80d7ca2]
    [0xffffe410]
    /lib/libc.so.6(abort+0x188) [0xb7d10238]
    /usr/lib/libglib-2.0.so.0(g_assertion_message+0x129) [0xb7efd049]
    /usr/lib/libglib-2.0.so.0 [0xb7efd4dd]
    mono [0x8079dce]
    mono [0x8062702]
    mono [0x80642b1]
    mono [0x8064d3f]
    mono [0x80da4c6]
    mono [0x80db162]
    [0xb7f59066]
    [0xb712a5b2]
    [0xb712a4f4]
    [0xb712a3fd]
    [0xb712a1b9]
    [0xb712a284]
    mono [0x8064e25]
    mono(mono_runtime_invoke+0x40) [0x817c670]
    mono(mono_runtime_exec_main+0xe2) [0x817ff02]
    mono(mono_runtime_run_main+0x16d) [0x818027d]
    mono(mono_main+0x196c) [0x80b67ec]
    mono [0x805b9c1]
    /lib/libc.so.6(__libc_start_main+0xe5) [0xb7cfa5f5]
    mono(g_ascii_strcasecmp+0x99) [0x805b8f1]

Debug info from gdb:

[Thread debugging using libthread_db enabled]
[New Thread 0xb7ce26f0 (LWP 14239)]
[New Thread 0xb6d29b90 (LWP 14242)]
[New Thread 0xb7129b90 (LWP 14241)]
[New Thread 0xb7bbdb90 (LWP 14240)]
0xffffe430 in __kernel_vsyscall ()
  4 Thread 0xb7bbdb90 (LWP 14240)  0xffffe430 in __kernel_vsyscall ()
  3 Thread 0xb7129b90 (LWP 14241)  0xffffe430 in __kernel_vsyscall ()
  2 Thread 0xb6d29b90 (LWP 14242)  0xffffe430 in __kernel_vsyscall ()
  1 Thread 0xb7ce26f0 (LWP 14239)  0xffffe430 in __kernel_vsyscall ()

Thread 4 (Thread 0xb7bbdb90 (LWP 14240)):
#0  0xffffe430 in __kernel_vsyscall ()
#1  0xb7e56c15 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so0
#2  0x081fc68b in GC_wait_marker () at pthread_support.c:1785
#3  0x081ffeee in GC_help_marker (my_mark_no=2) at mark.c:1116
#4  0x081fb515 in GC_mark_thread (id=0x0) at pthread_support.c:548
#5  0xb7e53175 in start_thread () from /lib/libpthread.so.0
#6  0xb7db1dae in clone () from /lib/libc.so.6

Thread 3 (Thread 0xb7129b90 (LWP 14241)):
#0  0xffffe430 in __kernel_vsyscall ()
#1  0xb7e5a3e6 in nanosleep () from /lib/libpthread.so.0
#2  0x081e18e8 in collection_thread (unused=0x0) at collection.c:34
#3  0xb7e53175 in start_thread () from /lib/libpthread.so.0
#4  0xb7db1dae in clone () from /lib/libc.so.6

Thread 2 (Thread 0xb6d29b90 (LWP 14242)):
#0  0xffffe430 in __kernel_vsyscall ()
#1  0xb7e58ee5 in sem_wait@@GLIBC_2.1 () from /lib/libpthread.so.0
#2  0x08156328 in finalizer_thread (unused=0x0) at gc.c:1022
#3  0x08150166 in start_wrapper (data=0x832f3c8) at threads.c:721
#4  0x081dbb96 in thread_start_routine (args=0x831b4a4) at wthreads.c:286
#5  0x081fc31d in GC_start_routine (arg=0x26f20) at pthread_support.c:1390
#6  0xb7e53175 in start_thread () from /lib/libpthread.so.0
#7  0xb7db1dae in clone () from /lib/libc.so.6

Thread 1 (Thread 0xb7ce26f0 (LWP 14239)):
#0  0xffffe430 in __kernel_vsyscall ()
#1  0xb7e59bab in read () from /lib/libpthread.so.0
#2  0x080d7e23 in mono_handle_native_sigsegv (signal=6, ctx=0xbfa93d9c) at
mini-exceptions.c:1834
#3  <signal handler called>
#4  0xffffe430 in __kernel_vsyscall ()
#5  0xb7d0e900 in raise () from /lib/libc.so.6
#6  0xb7d10238 in abort () from /lib/libc.so.6
#7  0xb7efd049 in g_assertion_message () from /usr/lib/libglib-2.0.so.0
#8  0xb7efd4dd in g_assertion_message_expr () from /usr/lib/libglib-2.0.so.0
#9  0x08079dce in mono_method_to_ir (cfg=0x8337818, method=0x833ea7c,
start_bblock=0x0, end_bblock=0x0, return_var=0x0, dont_inline=0x0,
inline_args=0x0, inline_offset=0, 
    is_virtual_call=0) at method-to-ir.c:5466
#10 0x08062702 in mini_method_compile (method=0x833ea7c, opts=59861503,
domain=0x25e70, run_cctors=<value optimized out>, compile_aot=<value optimized
out>, parts=0) at mini.c:3745
#11 0x080642b1 in mono_jit_compile_method_with_opt (method=0x833ea7c,
opt=59861503, ex=0xbfa947a0) at mini.c:4361
#12 0x08064d3f in mono_jit_compile_method (method=0x833ea7c) at mini.c:4578
#13 0x080da4c6 in common_call_trampoline (regs=0xbfa94878, code=0xb712a636
"\203�\020��", arg=<value optimized out>, tramp=0x0, vt=0x0, vtable_slot=0x0,
need_rgctx_tramp=0)
    at mini-trampolines.c:470
#14 0x080db162 in mono_magic_trampoline (regs=0xbfa94878, code=0xb712a636
"\203�\020��", arg=0x833ea7c, tramp=0x0) at mini-trampolines.c:586
#15 0xb7f59066 in ?? ()
#16 0xb712a5b2 in ?? ()
#17 0xb712a4f4 in ?? ()
#18 0xb712a3fd in ?? ()
#19 0xb712a1b9 in ?? ()
#20 0xb712a284 in ?? ()
#21 0x08064e25 in mono_jit_runtime_invoke (method=0x82f809c, obj=0x0,
params=0xbfa94a28, exc=0x0) at mini.c:4906
#22 0x0817c670 in mono_runtime_invoke (method=0x82f809c, obj=0x0,
params=0xbfa94a28, exc=0x0) at object.c:2605
#23 0x0817ff02 in mono_runtime_exec_main (method=0x82f809c, args=0x4dfc0,
exc=0x0) at object.c:3703
#24 0x0818027d in mono_runtime_run_main (method=0x82f809c, argc=1,
argv=0xbfa94c88, exc=0x0) at object.c:3326
#25 0x080b67ec in mono_main (argc=2, argv=0xbfa94c84) at driver.c:997
#26 0x0805b9c1 in main (argc=0, argv=0x0) at main.c:34
#0  0xffffe430 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.
=================================================================

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


More information about the mono-bugs mailing list