[Mono-bugs] [Bug 74971][Nor] New - [REGRESSION] Console change in 1.1.7

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Mon May 16 18:52:22 EDT 2005


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 bmaurer at users.sf.net.

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

--- shadow/74971	2005-05-16 18:52:22.000000000 -0400
+++ shadow/74971.tmp.12434	2005-05-16 18:52:22.000000000 -0400
@@ -0,0 +1,85 @@
+Bug#: 74971
+Product: Mono: Class Libraries
+Version: 1.1
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: CORLIB
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: bmaurer at users.sf.net               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: [REGRESSION] Console change in 1.1.7
+
+The following test case does not work on 1.1.7. Apparently, it worked fine
+in 1.1.6 and works on msft:
+
+using System;
+using System.IO;
+
+class Mandelbrot {
+
+   public static void Main(String[] args) {
+
+      int width = 100;
+      if (args.Length > 0) width = Int32.Parse(args[0]);
+
+      int height = width, i, m = 50, bits = 0, bitnum = 0;
+      bool isOverLimit = false;
+      double Zr = 0.0, Zi  = 0.0, Cr, Ci, Tr, Ti, limit2 = 4.0;
+
+      Console.WriteLine("P4");
+      Console.WriteLine("{0} {1}", width,height);
+      Stream s = Console.OpenStandardOutput(1024);
+
+      for(int y = 0; y < height; y++) {
+         for(int x = 0; x < width; x++){
+
+            Zr = 0.0; Zi = 0.0;
+            Cr = 2.0*x / width - 1.5;
+            Ci = 2.0*y / height - 1.0;
+
+            i = 0;
+            do {
+               Tr = Zr*Zr - Zi*Zi + Cr;
+               Ti = 2.0*Zr*Zi + Ci;
+               Zr = Tr; Zi = Ti;
+               isOverLimit = Zr*Zr + Zi*Zi > limit2;
+            } while (!isOverLimit && (++i < m));
+
+            bits = bits << 1;
+            if (!isOverLimit) bits++;
+            bitnum++;
+
+            if (x == width - 1) {
+               bits = bits << (8 - bitnum);
+               bitnum = 8;
+            }
+
+            if (bitnum == 8){
+               s.WriteByte((byte)bits);
+               bits = 0; bitnum = 0;
+            }
+         }
+      }
+   }
+}
+
+From:
+http://shootout.alioth.debian.org/great/benchmark.php?test=mandelbrot&lang=csharp&id=0&sort=fullcpu
+
+I get:
+
+[benm at omega benm]$ mono a.exe
+P4
+100 100
+ 
+Unhandled Exception: System.IndexOutOfRangeException: Array index is out of
+range.
+in <0x00070> System.IO.FileStream:WriteByte (Byte value)
+in <0x0023a> Mandelbrot:Main (System.String[] args)


More information about the mono-bugs mailing list