title: Index was outside the bounds of the array occurs on array initialization?
body: <p>My program has been working fine for 2 months. But we received this exception today.</p>
  <p>The program is multi-thread program. But only one thread use this class.</p>
  <p>It is release mode, without Visual Studio.</p>
  <p>The exception throws at this line:</p>
  <pre><code>int[] list = new int[count]; //Count = 52
  </code></pre>
  <p>The function is:</p>
  <pre><code>private static readonly Random _rand = new Random();
  public static int[] GetList(int count)
      {
          int[] list = new int[count]; // this is line 21
          for (int i = 0; i &lt; count; i++)
          {
              list[i] = i;
          }
          for (int i = 0; i &lt; count * count; i++)
          {
              int i1 = _rand.Next(count);
              int i2 = _rand.Next(count);
  
              if (i1 == i2) continue;
  
              //swap values
              list[i1] ^= list[i2];
              list[i2] ^= list[i1];
              list[i1] ^= list[i2];
          }
          return list;
      }
  </code></pre>
  <p>Part of the log is:</p>
  <blockquote>
  <p>Index was outside the bounds of the array.</p>
  <p>at iCulture.GameFramework.Util.RandomList.GetList(Int32 count) in C:\Rm716b\texasgame\TexasHoldem\trunk\iCulture.GameFramework\Util\RandomList.cs:line 21</p>
  <p>at iCulture.Texas.Cards..ctor() in C:\Rm716b\texasgame\TexasHoldem\trunk\iCulture.Texas\Cards.cs:line 18</p>
  <p>at iCulture.Texas.TexasGame..ctor(Player[] ParticipatePlayers, Int32 SmallBindAmount, Int32 SmallBlindPosition) in C:\Rm716b\texasgame\TexasHoldem\trunk\iCulture.Texas\TexasGame.cs:line 46</p>
  </blockquote>
  <p>I have tried decompiling the DLL, but the code logic remains the same as the original source code.</p>
  <p>It is possible hardware error cause this problem? Because it DOES NOT reappear since then.</p>