Janne Rantala wrote: >> The Windows port seems to use SEH. Maybe a SEH handler >> could be able to catch the exception: >> >> #include <windows.h> >> >> MonoException *ex; >> >> __try { >> mono_runtime_invoke ( ..., &ex); >> } >> __except (EXCEPTION_EXECUTE_HANDLER) { >> >> /* simulate a NRE */ >> ex = mono_get_exception_null_reference (); >> } >> >> if (ex != NULL) { >> handle the exception >> } >> >> The code is for VC++ in C mode (not C++). >> >> Robert >> > > Hi, > > That works very well, thanks. It would be nice if both Linux and > Windows version would work the same way though.
Please file a bug, because the SEH handler above only cures the symptoms partially. It seems that Mono's SIGSEGV handler doesn't get installed at all, when mono-1.dll is LoadLibrary'ed from another DLL. W/out this handler every true NRE is uncatchable. This could lead to nasty bugs, because some library code might rely on catching those NREs. Robert _______________________________________________ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list