[Mono-bugs] [Bug 81956][Wis] Changed - ArrayOutOfBounds in BigInteger class

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Thu Jul 5 12:24:34 EDT 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 sebastien at ximian.com.

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

--- shadow/81956	2007-07-04 09:01:29.000000000 -0400
+++ shadow/81956.tmp.3829	2007-07-05 12:24:34.000000000 -0400
@@ -360,6 +360,28 @@
             System.Threading.Thread.Sleep(50);
         }
         return;
     }
 }
 
+
+------- Additional Comments From sebastien at ximian.com  2007-07-05 12:24 -------
+I couldn't duplicate the issue on Windows (with SVN HEAD) but I don't
+have a MP box (P4 with HT). If this is a MP issue then I suspect that
+MS RNG is MT safe on a single CPU but not on multiple CPU. 
+
+The following patch will ensure each thread doesn't share it's RNG
+instance.
+
+Index: Mono.Math/BigInteger.cs
+===================================================================
+--- Mono.Math/BigInteger.cs     (revision 81399)
++++ Mono.Math/BigInteger.cs     (working copy)
+@@ -500,6 +500,7 @@
+                #endregion
+
+                #region Random
++               [ThreadStatic]
+                private static RandomNumberGenerator rng;
+                private static RandomNumberGenerator Rng {
+                        get {
+


More information about the mono-bugs mailing list