[Mono-dev] crash on first runtime_invoke (using MSVC build)

Virgile Bello virgile.bello at gmail.com
Fri Jan 14 16:58:14 EST 2011

Recently, I had some problem with the VS2010 build of mono.
Runtime check complains ESP is wrong after first time runtime_invoke is

I traced it back to this single-line commit.
(Reverting this single line avoids the problem on any version up to master)


   Mark runtime invoke wrappers as pinvoke, since they are called from
native code.

diff --git a/mono/metadata/marshal.c b/mono/metadata/marshal.c
index 476d129..c586555 100644
--- a/mono/metadata/marshal.c
+++ b/mono/metadata/marshal.c
@@ -4571,6 +4571,7 @@ mono_marshal_get_runtime_invoke (MonoMethod *method,
gboolean virtual)
        csig->params [1] = &mono_defaults.int_class->byval_arg;
        csig->params [2] = &mono_defaults.int_class->byval_arg;
        csig->params [3] = &mono_defaults.int_class->byval_arg;
+       csig->pinvoke = 1;

        name = mono_signature_to_name (callsig, virtual ?
"runtime_invoke_virtual" : "runtime_invoke");
        mb = mono_mb_new (target_klass, name,  MONO_WRAPPER_RUNTIME_INVOKE);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20110115/b38fc48c/attachment.html 

More information about the Mono-devel-list mailing list