[Mono-bugs] [Bug 57957][Nor] New - failure in biginterger when signing with ppc jit

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sun, 2 May 2004 14:29:42 -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 lupus@ximian.com.

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

--- shadow/57957	2004-05-02 14:29:42.000000000 -0400
+++ shadow/57957.tmp.12736	2004-05-02 14:29:42.000000000 -0400
@@ -0,0 +1,40 @@
+Bug#: 57957
+Product: Mono: Runtime
+Version: unspecified
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: lupus@ximian.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: failure in biginterger when signing with ppc jit
+
+When signing the SharpZipLib assembly there is a crash.
+The issue is in the following loop in multiByteDivide():
+					do {
+						//Console.WriteLine ("multiline in loop2: {0} {1} {2} {3}", dPos,
+nPos, mc, t);
+						mc += (ulong)bi2.data [dPos] * (ulong)uint_q_hat;
+						t = remainder [nPos];
+						//Console.WriteLine ("multiline in2 loop2: {0} {1} {2} {3}", dPos,
+nPos, mc, t);
+						remainder [nPos] -= (uint)mc;
+						mc >>= 32;
+						//Console.WriteLine ("multiline in3 loop2: {0} {1} {2} {3}", dPos,
+nPos, mc, t);
+						if (remainder [nPos] > t) mc++;
+						dPos++; nPos++;
+					} while (dPos < divisorLen);
+Uncommenting the last writeline makes it work ok (the bug manifests with an
+integeroutofrange exception in the BigInterger ctor).		public BigInteger
+(BigInteger bi, uint len)
+doesn't check that len is >= bi.length.
+A speedup for the shift operation hides the problem (look in mini.c for a
+reference to this bug).