[Mono-bugs] [Bug 77544][Maj] New - System.ArraySegment "out of
bounds"
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Mon Feb 13 13:10:26 EST 2006
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 naasking at gmail.com.
http://bugzilla.ximian.com/show_bug.cgi?id=77544
--- shadow/77544 2006-02-13 13:10:26.000000000 -0500
+++ shadow/77544.tmp.1025 2006-02-13 13:10:26.000000000 -0500
@@ -0,0 +1,58 @@
+Bug#: 77544
+Product: Mono: Class Libraries
+Version: 1.1
+OS:
+OS Details: Windows XP
+Status: NEW
+Resolution:
+Severity:
+Priority: Major
+Component: System
+AssignedTo: mono-bugs at ximian.com
+ReportedBy: naasking at gmail.com
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: System.ArraySegment "out of bounds"
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+
+Description of Problem:
+
+System.ArraySegment constructor incorrectly says bounds are out of range,
+when they are not.
+
+
+Steps to reproduce the problem:
+
+The following code snippet reproduces it everytime.
+
+byte[] tmp = new byte[4096];
+ArraySegment<byte> seg = new ArraySegment<byte>(tmp, 0, tmp.Length);
+Console.WriteLine("seg.off: " + seg.Offset + ", " + seg.Count);
+Console.ReadLine();
+
+However, the omitting the explicit bounds *does not* have this problem.
+
+byte[] tmp = new byte[4096];
+ArraySegment<byte> seg = new ArraySegment<byte>(tmp); //no explicit bounds
+Console.WriteLine("seg.off: " + seg.Offset + ", " + seg.Count);
+Console.ReadLine();
+
+
+Actual Results:
+"System.ArgumentException: out of bounds" in System.ArraySegment constructor
+
+
+Expected Results:
+Console output should be: "seg.off: 0, 4096"
+
+
+How often does this happen?
+
+Everytime.
+
+
+Additional Information:
More information about the mono-bugs
mailing list