[Mono-bugs] [Bug 683409] SMP problems on ARM
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Thu Apr 7 15:01:29 EDT 2011
https://bugzilla.novell.com/show_bug.cgi?id=683409
https://bugzilla.novell.com/show_bug.cgi?id=683409#c4
--- Comment #4 from Zoltan Varga <vargaz at gmail.com> 2011-04-07 19:01:28 UTC ---
The following patch is also getting hit, which means the same object pointer is
allocated to two different threads:
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
diff --git a/mono/metadata/object.c b/mono/metadata/object.c
index 250e947..2415f1d 100644
--- a/mono/metadata/object.c
+++ b/mono/metadata/object.c
@@ -4833,6 +4833,9 @@ mono_string_new_utf16 (MonoDomain *domain, const guint16
*text, gi
return s;
}
+static void *strings [100000];
+int nstrings = 0;
+
/**
* mono_string_new_size:
* @text: a pointer to an utf16 string
@@ -4857,6 +4860,19 @@ mono_string_new_size (MonoDomain *domain, gint32 len)
#ifndef HAVE_SGEN_GC
s = mono_object_allocate_ptrfree (size, vtable);
+ {
+ int n = InterlockedIncrement (&nstrings);
+
+ if (n < 10000) {
+ if (strings [n - 1] == s) {
+ printf ("BOO!\n");
+ *(int*)0 = 0;
+ }
+
+ strings [n] = s;
+ }
+ }
+
s->length = len;
#else
s = mono_gc_alloc_string (vtable, size, len);
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
More information about the mono-bugs
mailing list