[Mono-bugs] [Bug 80799][Wis] Changed - Multithreaded App crashes in random locations

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sun Feb 11 23:17:45 EST 2007


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by robertj at gmx.net.

http://bugzilla.ximian.com/show_bug.cgi?id=80799

--- shadow/80799	2007-02-11 18:38:06.000000000 -0500
+++ shadow/80799.tmp.30665	2007-02-11 23:17:45.000000000 -0500
@@ -90,6 +90,25 @@
 ------- Additional Comments From joncham at gmail.com  2007-02-11 18:38 -------
 The above patch is not acceptable (I have not done much threaded
 coding and this can be done in a better way), but it does seem fix the
 problem for the most part. I still see a crash every once in a while,
 thus the need for a better patch or else some more locks somewhere
 else. It seems to demonstrate this is a race condition if nothing else.
+
+------- Additional Comments From robertj at gmx.net  2007-02-11 23:17 -------
+Jon, that's not the runtime. SWF respectively System.Drawing
+(GDIplus) isn't thread safe. If you put a lock like here:
+
+	public static void MyThreadStart() {
+		Form f;
+		lock (locker) {
+			f = new Form ();
+		}
+		Application.Run (new Form());
+        }
+
+you'll see that things start to go slightly better.
+Often I get MemberAccessExceptions from GDI+, which means
+that a GDI+ object that was created in one thread is
+consumed in another thread. I bet there are some static
+shared objects inside SWF.
+


More information about the mono-bugs mailing list