Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report for Bug 34398 on
GitHub or Developer Community if you have new
information to add and do not yet see a matching new report.
If the latest results still closely match this report, you can use the
In special cases on GitHub you might also want the comments:
GitHub Markdown with public comments
We don't call mono_invoke_unhandled_exception_hook for all unhandled exception.
This is making the iOS team job harder when debugging issues related to it.
We should fix this puppy and add tests for that entrypoint.
Apparently unhandled exceptions in finalizers are ignored if there's an AppDomain.UnhandledException handler.
Just to save what I found out:
There's mono_unhandled_exception , which doesn't always exit  nor call the hook.
mono_unhandled_exception is called by:
1) ves_icall_System_Runtime_Remoting_Messaging_AsyncResult_Invoke , but that function doesn't check if the process should exit (nor does it call the hook)
2) mono_thread_internal_unhandled_exception , which exits (but doesn't call the hook) if Environment.ExitCode is 1 (which the user can change if they wish).
3) mono_handle_exception_internal , which also doesn't call neither the hook nor does it ever exit.
 It's setting Environment.ExitCode to signal that the process should terminate, but the user can also set this in any event handler.