[Mono-devel-list] marshal.c assertion failed.

Scott Mohekey scott.mohekey at telogis.com
Wed Feb 23 19:37:42 EST 2005


You were spot on Willi. I've attached a patch that corrects this issue.

Scott.

Willibald Krenn wrote:

> Scott Mohekey schrieb:
>
>> I've considered this, however in every case the pointer is NOT null. 
>> As far as I can tell, either the lookup code in domain.c for the 
>> jit_info_table is buggy and returns false positives, or another code 
>> path is removing the JitInfo prematurely.
>
>
> Is mono_delegate_free_ftnptr executed within the correct domain? I ask 
> this, because run_finalize (in gc.c) does not set the domain for a 
> call to this function: Being in the wrong domain would also lead to ji 
> not being found.
>
> HTH
>  Willi
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
Index: mono/mono/metadata/gc.c
===================================================================
--- mono/mono/metadata/gc.c     (revision 41118)
+++ mono/mono/metadata/gc.c     (working copy)
@@ -81,8 +81,18 @@
         */
        if (o->vtable->klass->delegate) {
                MonoDelegate* del = (MonoDelegate*)o;
+               MonoDomain* domain = mono_domain_get ();
+
+               if (domain != o->vtable->domain) {
+                       mono_domain_set_internal (o->vtable->domain);
+               }
+
                if (del->delegate_trampoline)
                        mono_delegate_free_ftnptr ((MonoDelegate*)o);
+
+               if (domain != o->vtable->domain) {
+                       mono_domain_set_internal (domain);
+               }
                return;
        }
        if (o->vtable->klass == mono_get_thread_class ())




More information about the Mono-devel-list mailing list