[Mono-dev] Fixing all promiscuous use of mono_raise_exception
kumpera at gmail.com
Thu Aug 13 19:20:25 EDT 2009
The runtime function mono_raise_exception is very problematic and can't be
as promiscuous as it currently is.
The issue is that it will unwind the current block of unmanaged code
it's state, which can be holding locks or floating memory (that needs to be
To avoid such problems I'm going to remove all uses of mono_raise_exception
that are not an icall, a top level trampoline target or has explicit
parameter telling to raise it.
Here is the list of functions that do causes problems for the runtime. The
functions or their callers
must be reworked to avoid memory leaks or deadlocks (all of those functions
are called with the loader lock held):
The most problematic here is mono_string_to_utf8 that has over a 100 calls
spread all over the runtime.
I think we should deprecated and replaced with a version that doesn't raise
and just return null.
Callers of all object allocation functions must be audited as well because
those can throw too.
Those are deemed problematic as well and all callers must respect the
that applies to mono_raise_exception.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Mono-devel-list