[Mono-bugs] [Bug 74927][Maj] New - DivideByZeroException thrown in uint division when NOT dividing by zero.
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Thu, 12 May 2005 18:44:38 -0400 (EDT)
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 siddacious@gmail.com.
http://bugzilla.ximian.com/show_bug.cgi?id=74927
--- shadow/74927 2005-05-12 18:44:38.000000000 -0400
+++ shadow/74927.tmp.9213 2005-05-12 18:44:38.000000000 -0400
@@ -0,0 +1,64 @@
+Bug#: 74927
+Product: Mono: Compilers
+Version: 1.1
+OS:
+OS Details: Linux 2.6.5-7.111.19 x86_64 x86_64 x86_64 GNU/Linux
+Status: NEW
+Resolution:
+Severity:
+Priority: Major
+Component: C#
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: siddacious@gmail.com
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: DivideByZeroException thrown in uint division when NOT dividing by zero.
+
+Description of Problem:
+In some cases, uint division throws a DivideByZeroException
+when the high bit of the dividend is set but the divisor is not zero.
+
+
+Steps to reproduce the problem:
+Compile and run this:
+
+using System;
+
+public class MonoDivideProblem
+{
+ static uint dividend = 0x80000000;
+ static uint divisor = 1;
+ public static void Main(string[] args)
+ {
+ Console.WriteLine("Dividend/Divisor = {0}", dividend/divisor);
+ }
+
+}
+
+Actual Results:
+
+$ ./MonoDivideProblem.exe
+
+Unhandled Exception: System.DivideByZeroException: Division by zero
+in <0x0002d> MonoDivideProblem:Main (System.String[] args)
+$
+
+Expected Results:
+
+It should have printed
+ Dividend/Divisor = 2147483648
+like it does when compiled with
+csc (Compiler version 7.10.6001.4, framework 1.1.4322) on Windows.
+
+
+How often does this happen?
+
+Every single time.
+
+Additional Information:
+
+The patterns we notice are:
+ -- division is a uint divided by a uint
+ -- the high bit is set in the dividend (e.g. 0x80000000)