[Mono-bugs] [Bug 664249] New: The runtime crashes when an NRE is raised from native code during variable evaluation.

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Jan 13 09:01:48 EST 2011


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

https://bugzilla.novell.com/show_bug.cgi?id=664249#c0


           Summary: The runtime crashes when an NRE is raised from native
                    code during variable evaluation.
    Classification: Mono
           Product: Mono: Runtime
           Version: 2.6.x
          Platform: x86-64
        OS/Version: Windows 7
            Status: NEW
          Severity: Critical
          Priority: P5 - None
         Component: debug
        AssignedTo: martin at novell.com
        ReportedBy: taktaktaktaktaktaktaktaktaktak at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US;
rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13

The runtime crashes when a null reference exception is raised from native code
during variable evaluation. Appears to happen only on windows (I'm using a
32bit embedded mono runtime on windows 7 x86-64).

Spent quite a bit of time trying to debug this - it appears that the exception
gets handled normally in the runtime itself, but the crash occurs when
transitioning back to native code: i.e., the handler code seems to execute up
to restore_context(), but the debugger agent code never executes anything after
mono_runtime_invoke.

// C Code
void throw_native_exception () {
    MonoException* exception = mono_exception_from_name_msg (mono_get_corlib
(), "System", "NullReferenceException", "");
    mono_raise_exception (exception);
}

// C# Code
[DllImport(blah)]
public static extern void throw_native_exception();

public int throw_managed_exception() {
    string s = null;
    return s.Length;
}

Reproducible: Always

Steps to Reproduce:
Create an embedded project that invokes some managed code.
Run with sdb, break inside the managed code.
In the immediate window, ?throw_managed_exception() will fail gracefully.
In the immediate window, ?throw_native_exception() will crash the runtime.
(This also affects hover-inspection, watch pad, etc., in MD.)

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