[Mono-bugs] [Bug 431254] New: The --debug-casts option does not work or crashes mono

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Oct 1 09:20:04 EDT 2008


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


           Summary: The --debug-casts option does not work or crashes mono
           Product: Mono: Runtime
           Version: SVN
          Platform: x86
        OS/Version: Kubuntu
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: debug
        AssignedTo: martin at novell.com
        ReportedBy: Lukasz.Piatkowski at secpl.cs.put.poznan.pl
         QAContact: mono-bugs at lists.ximian.com
          Found By: Community User


Created an attachment (id=242814)
 --> (https://bugzilla.novell.com/attachment.cgi?id=242814)
Sample application that renders InvalidCastException

I tried using the --debug=casts feature on mono from svn. In bigger application
it caused a native stacktrace (included below). On a simpler test case
(attached) it just don't work, ie.

mono --debug ./test.exe
Unhandled Exception: System.InvalidCastException: Cannot cast from source type
to destination type.
  at Test.Main () [0x0000c] in /tmp/test.cs:10

mono --debug=casts ./test.exe
Unhandled Exception: System.InvalidCastException: Cannot cast from source type
to destination type.
  at Test.Main () [0x0000c] in /tmp/test.cs:10

So the output is exactly the same.

Mono version:
mono -V
Mono JIT compiler version 2.1 (/trunk/mono r114372)
Copyright (C) 2002-2008 Novell, Inc and Contributors. www.mono-project.com
        TLS:           __thread
        GC:            Included Boehm (with typed GC)
        SIGSEGV:       altstack
        Notifications: epoll
        Architecture:  x86
        Disabled:      none

Native stacktrace:
[mono-2.0] /tmp/lab/lab1_app2/lab1_app2$ mono --debug=casts cardal.exe --show
Stacktrace:


Native stacktrace:

        mono [0x80706a4]
        mono [0x808ae51]
        [0xb7ef7440]
        mono [0x81468a1]
        mono [0x8150441]
        mono [0x806faa0]
        mono [0x808b9b5]
        [0xb7b17a0d]
        [0xb67d4c77]
        [0xb777253c]
        [0xb777220d]
        mono(mono_runtime_exec_main+0xeb) [0x80d968b]
        mono(mono_runtime_run_main+0x173) [0x80dabc3]
        mono(mono_main+0x16eb) [0x805cc0b]
        mono [0x805af82]
        /lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe0) [0xb7c9f450]
        mono [0x805aef1]

Debug info from gdb:

Cannot access memory at address 0x0
[Thread debugging using libthread_db enabled]
[New Thread 0xb7c47960 (LWP 26921)]
[New Thread 0xb68feb90 (LWP 26926)]
[New Thread 0xb69ffb90 (LWP 26925)]
[New Thread 0xb6c85b90 (LWP 26924)]
[New Thread 0xb7380b90 (LWP 26923)]
[New Thread 0xb7771b90 (LWP 26922)]
0xb7ef7410 in __kernel_vsyscall ()
  6 Thread 0xb7771b90 (LWP 26922)  0xb7ef7410 in __kernel_vsyscall ()
  5 Thread 0xb7380b90 (LWP 26923)  0xb7ef7410 in __kernel_vsyscall ()
  4 Thread 0xb6c85b90 (LWP 26924)  0xb7ef7410 in __kernel_vsyscall ()
  3 Thread 0xb69ffb90 (LWP 26925)  0xb7ef7410 in __kernel_vsyscall ()
  2 Thread 0xb68feb90 (LWP 26926)  0xb7ef7410 in __kernel_vsyscall ()
  1 Thread 0xb7c47960 (LWP 26921)  0xb7ef7410 in __kernel_vsyscall ()

Thread 6 (Thread 0xb7771b90 (LWP 26922)):
#0  0xb7ef7410 in __kernel_vsyscall ()
#1  0xb7e0a196 in nanosleep () from /lib/tls/i686/cmov/libpthread.so.0
#2  0x0816e501 in collection_thread (unused=0x0) at collection.c:34
#3  0xb7e024fb in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#4  0xb7d5fe5e in clone () from /lib/tls/i686/cmov/libc.so.6

Thread 5 (Thread 0xb7380b90 (LWP 26923)):
#0  0xb7ef7410 in __kernel_vsyscall ()
#1  0xb7e06aa5 in pthread_cond_wait@@GLIBC_2.3.2 () from
/lib/tls/i686/cmov/libpthread.so.0
#2  0x08167d9f in timedwait_signal_poll_cond (cond=0x832d6ec, mutex=0x832d6d4,
timeout=0x80, alertable=0) at handles.c:1490
#3  0x0816aade in _wapi_handle_timedwait_signal_handle (handle=0x404,
timeout=0x0, alertable=0) at handles.c:1570
#4  0x0816ab5c in _wapi_handle_wait_signal_handle (handle=0x404, alertable=0)
at handles.c:1530
#5  0x0815892a in WaitForSingleObjectEx (handle=0x404, timeout=4294967295,
alertable=0) at wait.c:205
#6  0x081108da in finalizer_thread (unused=0x0) at gc.c:930
#7  0x081310c0 in start_wrapper (data=0x832cf90) at threads.c:621
#8  0x081702c2 in thread_start_routine (args=0x832d92c) at threads.c:279
#9  0x0817ff37 in GC_start_routine (arg=0x35f20) at pthread_support.c:1382
#10 0xb7e024fb in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#11 0xb7d5fe5e in clone () from /lib/tls/i686/cmov/libc.so.6

Thread 4 (Thread 0xb6c85b90 (LWP 26924)):
#0  0xb7ef7410 in __kernel_vsyscall ()
#1  0xb7e06dd2 in pthread_cond_timedwait@@GLIBC_2.3.2 () from
/lib/tls/i686/cmov/libpthread.so.0
#2  0x08167d5a in timedwait_signal_poll_cond (cond=0x832d980, mutex=0x832d968,
timeout=0xb6c84fe4, alertable=1) at handles.c:1500
#3  0x0816aade in _wapi_handle_timedwait_signal_handle (handle=0x409,
timeout=0xb6c84fe4, alertable=1) at handles.c:1570
#4  0x0815873c in WaitForSingleObjectEx (handle=0x409, timeout=994,
alertable=1) at wait.c:207
#5  0x0812e10e in ves_icall_System_Threading_WaitHandle_WaitOne_internal
(this=0x6e420, handle=0x409, ms=994, exitContext=1) at threads.c:1441
#6  0xb6c90865 in ?? ()
#7  0xb6c90129 in ?? ()
#8  0xb6c8eb03 in ?? ()
#9  0xb777b0b2 in ?? ()
#10 0x080d48d4 in mono_runtime_delegate_invoke (delegate=0x409,
params=0xb6c85284, exc=0x0) at object.c:2711
#11 0x0813112e in start_wrapper (data=0x0) at threads.c:627
#12 0x081702c2 in thread_start_routine (args=0x832dab8) at threads.c:279
#13 0x0817ff37 in GC_start_routine (arg=0x35e20) at pthread_support.c:1382
#14 0xb7e024fb in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#15 0xb7d5fe5e in clone () from /lib/tls/i686/cmov/libc.so.6

Thread 3 (Thread 0xb69ffb90 (LWP 26925)):
#0  0xb7ef7410 in __kernel_vsyscall ()
#1  0xb7d60676 in epoll_wait () from /lib/tls/i686/cmov/libc.so.6
#2  0x081147ec in socket_io_epoll_main (p=0x82dabe0) at threadpool.c:548
#3  0x081310c0 in start_wrapper (data=0x8574978) at threads.c:621
#4  0x081702c2 in thread_start_routine (args=0x832dcc8) at threads.c:279
#5  0x0817ff37 in GC_start_routine (arg=0xc2fe0) at pthread_support.c:1382
#6  0xb7e024fb in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#7  0xb7d5fe5e in clone () from /lib/tls/i686/cmov/libc.so.6

Thread 2 (Thread 0xb68feb90 (LWP 26926)):
#0  0xb7ef7410 in __kernel_vsyscall ()
#1  0xb7e06dd2 in pthread_cond_timedwait@@GLIBC_2.3.2 () from
/lib/tls/i686/cmov/libpthread.so.0
#2  0x08167d5a in timedwait_signal_poll_cond (cond=0x832dc14, mutex=0x832dbfc,
timeout=0xb68fe1e8, alertable=1) at handles.c:1500
#3  0x0816aade in _wapi_handle_timedwait_signal_handle (handle=0x40e,
timeout=0xb68fe1e8, alertable=1) at handles.c:1570
#4  0x0815873c in WaitForSingleObjectEx (handle=0x40e, timeout=10000,
alertable=1) at wait.c:207
#5  0x08116082 in async_invoke_io_thread (data=0x0) at threadpool.c:280
#6  0x081310c0 in start_wrapper (data=0x84629c8) at threads.c:621
#7  0x081702c2 in thread_start_routine (args=0x832dd4c) at threads.c:279
#8  0x0817ff37 in GC_start_routine (arg=0xc2fe0) at pthread_support.c:1382
#9  0xb7e024fb in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#10 0xb7d5fe5e in clone () from /lib/tls/i686/cmov/libc.so.6

Thread 1 (Thread 0xb7c47960 (LWP 26921)):
#0  0xb7ef7410 in __kernel_vsyscall ()
#1  0xb7e0999b in read () from /lib/tls/i686/cmov/libpthread.so.0
#2  0x080707b2 in mono_handle_native_sigsegv (signal=11, ctx=0xb7b16d0c) at
mini-exceptions.c:1437
#3  0x0808ae51 in mono_arch_handle_altstack_exception (sigctx=0xb7b16d0c,
fault_addr=0xa6, stack_ovf=0) at exceptions-x86.c:854
#4  <signal handler called>
#5  mono_type_get_name_recurse (type=0xa0, str=0x87b0bb0, is_recursed=0,
format=MONO_TYPE_NAME_FORMAT_REFLECTION) at class.c:236
#6  0x081468a1 in mono_type_get_name_full (type=0xa0,
format=MONO_TYPE_NAME_FORMAT_REFLECTION) at class.c:406
#7  0x08150441 in mono_type_get_full_name (class=0x0) at class.c:421
#8  0x0806faa0 in mono_handle_exception_internal (ctx=0xbf927858, obj=0xeb8f8,
original_ip=0xb67d64ea, test_only=0, out_filter_idx=0x0) at
mini-exceptions.c:840
#9  0x0808b9b5 in throw_exception (eax=964856, ecx=3061671146, edx=76,
ebx=352224, esi=976528, edi=597888, ebp=3214047448, exc=0xeb8f8,
eip=3061671146, esp=3214047416, rethrow=-1233296150) at exceptions-x86.c:396
#10 0xb7b17a0d in ?? ()
#11 0xb67d4c77 in ?? ()
#12 0xb777253c in ?? ()
#13 0xb777220d in ?? ()
#14 0x080d968b in mono_runtime_exec_main (method=0x91f80, args=0x38f48,
exc=0x0) at object.c:3071
#15 0x080dabc3 in mono_runtime_run_main (method=0x830d33c, argc=2,
argv=0xbf927cec, exc=0x0) at object.c:2857
#16 0x0805cc0b in mono_main (argc=4, argv=0xbf927ce4) at driver.c:960
#17 0x0805af82 in main (argc=) at main.c:30
#0  0xb7ef7410 in __kernel_vsyscall ()

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

Aborted


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