Avoid freeing the allocated monitors on shutdown, it seems to cause crashes
authorZoltan Varga <vargaz@gmail.com>
Wed, 8 Sep 2010 23:12:09 +0000 (01:12 +0200)
committerZoltan Varga <vargaz@gmail.com>
Wed, 8 Sep 2010 23:13:28 +0000 (01:13 +0200)
when running with SGEN, since SGEN writes to those arrays in:

==29095==    at 0x6844E5: add_or_remove_disappearing_link (sgen-gc.c:4143)
==29095==    by 0x6845F8: mono_gc_register_disappearing_link (sgen-gc.c:4167)
==29095==    by 0x67DE35: clear_domain_process_object (sgen-gc.c:1384)
==29095==    by 0x67DEA3: clear_domain_process_major_object_callback (sgen-gc.c:1400)
==29095==    by 0x6DE2DC: major_iterate_objects (sgen-marksweep.c:692)
==29095==    by 0x67E00B: mono_gc_clear_domain (sgen-gc.c:1459)

mono/metadata/monitor.c

index c88d40c126794d5dc7c9d390c38afebac8f6c057..f4512a7675bcf5b7e65db09952974b333e21aed9 100644 (file)
@@ -129,10 +129,12 @@ mono_monitor_cleanup (void)
 
        /*DeleteCriticalSection (&monitor_mutex);*/
 
+       /* FIXME: This seems to cause crashes with SGEN
        for (marray = monitor_allocated; marray; marray = next) {
                next = marray->next;
                g_free (marray);
        }
+       */
 }
 
 /*