[svn:parrot] r39879 - trunk/src

whiteknight at svn.parrot.org whiteknight at svn.parrot.org
Sat Jul 4 15:05:24 UTC 2009

Author: whiteknight
Date: Sat Jul  4 15:05:23 2009
New Revision: 39879
URL: https://trac.parrot.org/parrot/changeset/39879

[gc] fix one gc heisenbug, although apparently this isn't the only one. When cloning an object, we get into situations where we mark the object before it's ATTRs struct is initialized. This causes whatever garbage was in that allocated memory to be passed to the GC for marking, and hilarity ensues. Zero out the struct here to ensure we have NULL values in the struct and then Parrot_Object_mark won't try to mark the NULL pointers


Modified: trunk/src/oo.c
--- trunk/src/oo.c	Sat Jul  4 14:07:12 2009	(r39878)
+++ trunk/src/oo.c	Sat Jul  4 15:05:23 2009	(r39879)
@@ -301,6 +301,7 @@
     /* Now create the underlying structure, and clone attributes list.class. */
     cloned_guts               = mem_allocate_typed(Parrot_Object_attributes);
+    memset(cloned_guts, 0, sizeof(Parrot_Object_attributes));
     PMC_data(cloned)          = cloned_guts;
     cloned_guts->_class       = obj->_class;
     cloned_guts->attrib_store = VTABLE_clone(interp, obj->attrib_store);

More information about the parrot-commits mailing list