[Mono-dev] Catching NRE in Embedded Mono

Jonathan Chambers joncham at gmail.com
Mon Jan 9 15:40:28 UTC 2012


You can also try and replace mono's usage of SetUnhandledExceptionFilter with
a call to AddVectoredExceptionHandler. Vectored exception handlers execute
before the standard exception handlers. The access violation will execute
the mono runtime exception handler before the VS debugger is notified. I
use this when I debug the mono exception handler code. Vectored exception
handling seems a little less forgiving if anything is wrong in the mono
exception handler code, so YMMV.

Thanks,
Jonathan

On Mon, Jan 9, 2012 at 10:29 AM, Robert Jordan <robertj at gmx.net> wrote:

> Jeff,
>
> On 09.01.2012 16:03, Jeff Ward wrote:
> > I'm not personally overriding the SIGSEGV handler (though I may in the
> > future) but the Visual Studio debugger may be?  Is that possible?
>
> Definitely. Last time I checked (I don't remember if it was with
> VS 2008 or 2010), I had to give up and use WinDbg instead.
>
> Maybe I didn't find the right knob to switch off this behavior...
>
> > I noticed signal chaining was added recently.  Do I need to turn this on
> /
> > off to get the behavior I'm expecting (mono handles most signals on its
> > own, before passing them on to the to the native code?)
>
> I believe that chaining would have the same issue.
>
> What may help is setting the env var
>
>        MONO_DEBUG=explicit-null-checks
>
> It instructs the runtime to generate NULL checks and throw "soft"
> NullReferenceExceptions.
>
> Robert
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20120109/d373b151/attachment.html 


More information about the Mono-devel-list mailing list