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

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Wed Jun 27 10:50:02 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 alan.mcgovern at gmail.com.

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

--- shadow/81956	2007-06-27 10:50:02.000000000 -0400
+++ shadow/81956.tmp.17079	2007-06-27 10:50:02.000000000 -0400
@@ -0,0 +1,199 @@
+Bug#: 81956
+Product: Mono: Class Libraries
+Version: 1.2
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: Mono.Security
+AssignedTo: sebastien at ximian.com                            
+ReportedBy: alan.mcgovern at gmail.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: ArrayOutOfBounds in BigInteger class
+
+Description of Problem:
+Occasionally (very occasionally) I've received bug reports mentioning this
+showing up in Visual Studio when running monotorrent:
+
+"Managed Debugging Assistant 'FatalExecutionEngineError' has detected a
+problem in 'X:ToolsAppsBitTorrentClientbinDebugBitTorrentClient.vshost.exe'.
+Additional Information: The runtime has encountered a fatal error. The
+address of the error was at 0x79eedb41, on thread 0x163c. The error code is
+0xc0000005. This error may be a bug in the CLR or in the unsafe or
+non-verifiable portions of user code. Common sources of this bug include
+user marshaling errors for COM-interop or PInvoke, which may corrupt the
+stack."
+
+I've also received this stacktrace:
+Mono.Security.dll!Mono.Math.BigInteger.Kernel.SquarePositive(Mono.Math.BigInteger
+bi, ref uint[] wkSpace = {Dimensions:[48]}) + 0x28c bytes
+Mono.Security.dll!Mono.Math.BigInteger.ModulusRing.OddPow(Mono.Math.BigInteger
+b =
+{605312534257947860382458784905968614019739521970587855117413152182321420850320005806812269151655657007816309302261852286833229800104302700141973790824665610441252756997464519258880370302755891184467376984074944484569641719817857474},
+Mono.Math.BigInteger exp =
+{896480836679002743627037989687303758593707897057}) + 0x189 bytes
+Mono.Security.dll!Mono.Math.BigInteger.ModulusRing.Pow(Mono.Math.BigInteger
+b =
+{605312534257947860382458784905968614019739521970587855117413152182321420850320005806812269151655657007816309302261852286833229800104302700141973790824665610441252756997464519258880370302755891184467376984074944484569641719817857474},
+Mono.Math.BigInteger exp =
+{896480836679002743627037989687303758593707897057}) + 0x41 bytes
+Mono.Security.dll!Mono.Math.BigInteger.ModPow(Mono.Math.BigInteger exp =
+{896480836679002743627037989687303758593707897057}, Mono.Math.BigInteger n
+=
+{1552518092300708935130918131258481755631334049434514313202351194902966239949102107258669453876591642442910007680288864229150803718918046342632727613031282983744380820890196288509170691316593175367469551763119843371637221007211169123})
++ 0x3f bytes
+>
+MonoTorrent.dll!MonoTorrent.Client.Encryption.ModuloCalculator.Calculate(Mono.Math.BigInteger
+a =
+{605312534257947860382458784905968614019739521970587855117413152182321420850320005806812269151655657007816309302261852286833229800104302700141973790824665610441252756997464519258880370302755891184467376984074944484569641719817857474},
+Mono.Math.BigInteger b =
+{896480836679002743627037989687303758593707897057}) Line 65 + 0x14 bytes C#
+MonoTorrent.dll!MonoTorrent.Client.Encryption.ModuloCalculator.Calculate(byte[]
+a = {Dimensions:[96]}, byte[] b = {Dimensions:[96]}) Line 50 + 0x34 bytes C#
+MonoTorrent.dll!MonoTorrent.Client.Encryption.EncryptedSocket.doneReceiveY(System.IAsyncResult
+result = {System.Net.Sockets.OverlappedAsyncResult}) Line 316 + 0xd bytes C#
+MonoTorrent.dll!MonoTorrent.Client.Encryption.PeerBEncryption.doneReceiveY(System.IAsyncResult
+result = {System.Net.Sockets.OverlappedAsyncResult}) Line 82 + 0xa bytes C#
+MonoTorrent.dll!MonoTorrent.Client.Encryption.EncryptedSocket.doneReceive(System.IAsyncResult
+result = {System.Net.Sockets.OverlappedAsyncResult}) Line 544 + 0xe bytes C#
+System.dll!System.Net.LazyAsyncResult.Complete(System.IntPtr userToken) +
+0x7f bytes
+System.dll!System.Net.ContextAwareResult.CompleteCallback(object state) +
+0x1a bytes
+mscorlib.dll!System.Threading.ExecutionContext.runTryCode(object userData)
++ 0x43 bytes
+[Native to Managed Transition]
+[Managed to Native Transition]
+mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext
+executionContext, System.Threading.ContextCallback callback, object state)
++ 0xa7 bytes
+mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext
+executionContext, System.Threading.ContextCallback callback, object state)
++ 0x92 bytes
+System.dll!System.Net.ContextAwareResult.Complete(System.IntPtr userToken)
++ 0xa7 bytes
+System.dll!System.Net.LazyAsyncResult.ProtectedInvokeCallback(object
+result, System.IntPtr userToken) + 0x8b bytes
+System.dll!System.Net.Sockets.BaseOverlappedAsyncResult.CompletionPortCallback(uint
+errorCode, uint numBytes, System.Threading.NativeOverlapped*
+nativeOverlapped) + 0x116 bytes
+mscorlib.dll!System.Threading._IOCompletionCallback.PerformIOCompletionCallback(uint
+errorCode, uint numBytes, System.Threading.NativeOverlapped* pOVERLAP) +
+0x68 bytes
+
+
+and this stack trace:
+Mono.Security.dll!Mono.Math.BigInteger.Kernel.SquarePositive(Mono.Math.BigInteger
+bi, ref uint[] wkSpace = {Dimensions:[48]}) + 0x28c bytes
+Mono.Security.dll!Mono.Math.BigInteger.ModulusRing.OddPow(Mono.Math.BigInteger
+b = {2}, Mono.Math.BigInteger exp =
+{715912159025296215735683509066306600323068105888}) + 0x189 bytes
+Mono.Security.dll!Mono.Math.BigInteger.ModulusRing.Pow(Mono.Math.BigInteger
+b = {2}, Mono.Math.BigInteger exp =
+{715912159025296215735683509066306600323068105888}) + 0x41 bytes
+Mono.Security.dll!Mono.Math.BigInteger.ModPow(Mono.Math.BigInteger exp =
+{715912159025296215735683509066306600323068105888}, Mono.Math.BigInteger n
+=
+{1552518092300708935130918131258481755631334049434514313202351194902966239949102107258669453876591642442910007680288864229150803718918046342632727613031282983744380820890196288509170691316593175367469551763119843371637221007211169123})
++ 0x3f bytes
+>
+MonoTorrent.dll!MonoTorrent.Client.Encryption.ModuloCalculator.Calculate(Mono.Math.BigInteger
+a = {2}, Mono.Math.BigInteger b =
+{715912159025296215735683509066306600323068105888}) Line 65 + 0x14 bytes C#
+MonoTorrent.dll!MonoTorrent.Client.Encryption.ModuloCalculator.Calculate(Mono.Math.BigInteger
+a = {2}, byte[] b = {Dimensions:[96]}) Line 55 + 0x1f bytes C#
+MonoTorrent.dll!MonoTorrent.Client.Encryption.EncryptedSocket.GenerateY()
+Line 628 + 0x10 bytes C#
+MonoTorrent.dll!MonoTorrent.Client.Encryption.EncryptedSocket.EncryptedSocket(MonoTorrent.Common.EncryptionType
+minCryptoAllowed = None) Line 142 + 0x7 bytes C#
+MonoTorrent.dll!MonoTorrent.Client.Encryption.PeerBEncryption.PeerBEncryption(System.Collections.Generic.List<MonoTorrent.Client.TorrentManager>
+torrents = Count = 3, MonoTorrent.Common.EncryptionType minCryptoAllowed =
+None) Line 49 + 0xa bytes C#
+MonoTorrent.dll!MonoTorrent.Client.ClientEngine.handleHandshake(MonoTorrent.Client.PeerId
+id = {10.11.19.214:1500}) Line 651 + 0x63 bytes C#
+MonoTorrent.dll!MonoTorrent.Client.ClientEngine.onPeerHandshakeReceived(System.IAsyncResult
+result = {System.Net.Sockets.OverlappedAsyncResult}) Line 613 + 0xb bytes C#
+System.dll!System.Net.LazyAsyncResult.Complete(System.IntPtr userToken) +
+0x7f bytes
+System.dll!System.Net.ContextAwareResult.CompleteCallback(object state) +
+0x1a bytes
+mscorlib.dll!System.Threading.ExecutionContext.runTryCode(object userData)
++ 0x43 bytes
+[Native to Managed Transition]
+[Managed to Native Transition]
+mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext
+executionContext, System.Threading.ContextCallback callback, object state)
++ 0xa7 bytes
+mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext
+executionContext, System.Threading.ContextCallback callback, object state)
++ 0x92 bytes
+System.dll!System.Net.ContextAwareResult.Complete(System.IntPtr userToken)
++ 0xa7 bytes
+System.dll!System.Net.LazyAsyncResult.ProtectedInvokeCallback(object
+result, System.IntPtr userToken) + 0x8b bytes
+System.dll!System.Net.Sockets.BaseOverlappedAsyncResult.CompletionPortCallback(uint
+errorCode, uint numBytes, System.Threading.NativeOverlapped*
+nativeOverlapped) + 0x116 bytes
+mscorlib.dll!System.Threading._IOCompletionCallback.PerformIOCompletionCallback(uint
+errorCode, uint numBytes, System.Threading.NativeOverlapped* pOVERLAP) +
+0x68 bytes
+
+and finally, this stacktrace:
+at Mono.Math.BigInteger.Kernel.Multiply(UInt32[] x, UInt32 xOffset, UInt32
+xLen, UInt32[] y, UInt32 yOffset, UInt32 yLen, UInt32[] d, UInt32 dOffset)
+at Mono.Math.BigInteger.ModulusRing.OddPow(BigInteger b, BigInteger exp)
+at Mono.Math.BigInteger.ModPow(BigInteger exp, BigInteger n)
+at MonoTorrent.Client.Encryption.ModuloCalculator.Calculate(BigInteger a,
+BigInteger b) in C:UsersAndy HendersonDocumentsVisual Studio
+2005ProjectsMonoTorrentClientEncryptionModuloCalculator.cs:line 64
+at MonoTorrent.Client.Encryption.ModuloCalculator.Calculate(Byte[] a,
+Byte[] b) in C:UsersAndy HendersonDocumentsVisual Studio
+2005ProjectsMonoTorrentClientEncryptionModuloCalculator.cs:line 49
+at MonoTorrent.Client.Encryption.EncryptedSocket.doneReceiveY(IAsyncResult
+result) in C:UsersAndy HendersonDocumentsVisual Studio
+2005ProjectsMonoTorrentClientEncryptionEncryptedSocket.cs:line 315
+at MonoTorrent.Client.Encryption.PeerBEncryption.doneReceiveY(IAsyncResult
+result) in C:UsersAndy HendersonDocumentsVisual Studio
+2005ProjectsMonoTorrentClientEncryptionPeerBEncryption.cs:line 66
+at MonoTorrent.Client.Encryption.EncryptedSocket.doneReceive(IAsyncResult
+result) in C:UsersAndy HendersonDocumentsVisual Studio
+2005ProjectsMonoTorrentClientEncryptionEncryptedSocket.cs:line 543
+at System.Net.LazyAsyncResult.Complete(IntPtr userToken)
+at System.Net.ContextAwareResult.CompleteCallback(Object state)
+at System.Threading.ExecutionContext.Run(ExecutionContext executionContext,
+ContextCallback callback, Object state)
+at System.Net.ContextAwareResult.Complete(IntPtr userToken)
+at System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr
+userToken)
+at
+System.Net.Sockets.BaseOverlappedAsyncResult.CompletionPortCallback(UInt32
+errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
+at
+System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32
+errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
+
+
+Hope that helps.
+
+
+
+Steps to reproduce the problem:
+1. 
+2. 
+3. 
+
+Actual Results:
+
+
+Expected Results:
+
+
+How often does this happen? 
+
+
+Additional Information:


More information about the mono-bugs mailing list