[Mono-bugs] [Bug 76010][Nor] Changed - Error when judging out of memory when using string and stringbuilder

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Wed Sep 7 12:24:44 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 sebastien at ximian.com.

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

--- shadow/76010	2005-09-07 11:24:01.000000000 -0400
+++ shadow/76010.tmp.26440	2005-09-07 12:24:44.000000000 -0400
@@ -1,16 +1,16 @@
 Bug#: 76010
-Product: Mono: Class Libraries
+Product: Mono: Runtime
 Version: 1.1
 OS: Red Hat 9.0
 OS Details: 
-Status: NEW   
-Resolution: 
-Severity: 008 One day
+Status: RESOLVED   
+Resolution: NOTABUG
+Severity: Unknown
 Priority: Normal
-Component: CORLIB
+Component: misc
 AssignedTo: mono-bugs at ximian.com                            
 ReportedBy: zig.wei at gmail.com               
 QAContact: mono-bugs at ximian.com
 TargetMilestone: ---
 URL: 
 Cc: 
@@ -65,6 +65,19 @@
 
 
 How often does this happen? 
 
 
 Additional Information:
+
+------- Additional Comments From sebastien at ximian.com  2005-09-07 12:24 -------
+No (len > size) is not always false. Just look at the comment on the
+previous line (hint: overflow).
+
+E.g. if len == Int32.MaxValue, then
+
+size = (sizeof (MonoString) + ((len + 1) * 2));
+size = 4 + (Int32.MaxValue + 1) * 2;
+size = 4;
+
+so (len > size), i.e. (Int32.MaxValue > 4) is true and an
+OutOfMemoryException is thrown.


More information about the mono-bugs mailing list