[Mono-bugs] [Bug 448131] New: 2.0.1 fails to handle System.NullReferenceException ( SIGSEGV)

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Nov 24 06:40:05 EST 2008


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


           Summary: 2.0.1 fails to handle System.NullReferenceException
                    (SIGSEGV)
           Product: Mono: Runtime
           Version: 2.0.x
          Platform: x86
        OS/Version: FreeBSD
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: misc
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: moko at moko.ru
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


test.cs

using System;

class Example
{
   public static void Main()
   {
        Object test=null;
        string s=test.ToString();
   }
}

mono 1.2.5.1 under FreeBSD (works normally):

Unhandled Exception: System.NullReferenceException: A null value was found
where an object instance was required.
  at Example.Main () [0x00000]

mono 2.0.1 under FreeBSD (fails):

Hangs consuming CPU.

(gdb) info threads
  3 Thread 0x28601100 (LWP 100405)  <signal handler called>
  2 Thread 0x28645a00 (LWP 100045)  0x28542a8b in nanosleep () from
/lib/libc.so.7
* 1 Thread 0x2865d700 (LWP 100108)  0x284d1927 in _umtx_op () from
/lib/libc.so.7

(gdb) thread 3
(gdb) bt
#0  <signal handler called>
#1  altstack_handle_and_restore (sigctx=0xbfbfe750, obj=0x0, stack_ovf=0) at
exceptions-x86.c:820
#2  0x2859a224 in ?? ()
#3  0xbfbfe750 in ?? ()
#4  0x00000000 in ?? ()
#5  0x00000000 in ?? ()
#6  0x2859a188 in ?? ()
#7  0x00000000 in ?? ()
#8  0x00000000 in ?? ()
#9  0x00000000 in ?? ()
#10 0x080855f4 in mono_arch_get_restore_context () at exceptions-x86.c:294

(gdb) thread 1
(gdb) bt
#0  0x284d1927 in _umtx_op () from /lib/libc.so.7
#1  0x2848ac49 in pthread_cleanup_push () from /lib/libthr.so.3
#2  0x2848973a in pthread_cond_init () from /lib/libthr.so.3
#3  0x0813cef5 in mono_type_full_name ()
#4  0x0813f8a0 in mono_type_full_name ()
#5  0x0813fa08 in mono_type_full_name ()
#6  0x08157fa8 in mono_pthread_key_for_tls ()
#7  0x080cf1b0 in mono_gc_is_finalizer_thread ()
#8  0x080f07c9 in mono_hazard_pointer_get ()
#9  0x08154f0f in mono_pthread_key_for_tls ()
#10 0x0816dd89 in GC_push_all_stack ()
#11 0x28483769 in pthread_getprio () from /lib/libthr.so.3
#12 0x00000000 in ?? ()

Workaround for this bug was found: 
Add in mono.c 

#undef MONO_ARCH_SIGSEGV_ON_ALTSTACK

After that exception is normally handled, at least at this test.
Additional information can be provided on requiest.


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