[Mono-bugs] [Bug 59557][Nor] New - Mono hangs when allocating memory

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Thu, 3 Jun 2004 11:27:28 -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 sebastien@ximian.com.

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

--- shadow/59557	2004-06-03 11:27:28.000000000 -0400
+++ shadow/59557.tmp.11806	2004-06-03 11:27:28.000000000 -0400
@@ -0,0 +1,91 @@
+Bug#: 59557
+Product: Mono: Runtime
+Version: unspecified
+OS: 
+OS Details: Fedora Core 1, 1Gb RAM
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: sebastien@ximian.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Mono hangs when allocating memory
+
+Description of Problem:
+Mono sometimes hangs when allocating memory. The results are predictable
+(repeatable) but they don't seems very logical to me.
+
+Steps to reproduce the problem:
+1. Compile this source code (multialloc.cs)
+
+using System;
+
+public class MultipleAllocations {
+
+	static void Main (string[] args) 
+	{
+		foreach (string arg in args) {
+			int x = Int32.Parse (arg);
+			try {
+				Console.WriteLine ("Allocating {0} characters", x);
+				String s = new String (' ', x);
+			}
+			catch (OutOfMemoryException) {
+				Console.WriteLine ("\tOutOfMemory");
+			}
+			catch (Exception e) {
+				Console.WriteLine (e.ToString ());
+				Console.ReadLine ();
+			}
+		}
+		Console.WriteLine ("Finished");
+	}
+}
+
+
+2. Execute it with the following parameters
+
+mono multialloc.exe 300000000 30000000
+
+Mono will hang when allocating the second String object.
+Wait as long as you wish and press Ctrl+C to continue.
+  
+
+3. Execute again with the following parameters
+
+mono multialloc.exe 200000000 20000000
+
+Mono will hang when allocating the second String object.
+Wait as long as you wish and press Ctrl+C to continue.
+
+
+4. Re-execute step 2.
+
+mono multialloc.exe 300000000 30000000
+
+Mono will hang when allocating the second String object.
+Wait as long as you wish and press Ctrl+C to continue.
+
+
+Actual Results:
+Second allocation fails when we allocate big objects.
+
+
+Expected Results:
+We know that there are enough memory to the second case (step 3) as we can
+allocate more memory before (step 2) and after (step 4).
+
+So why is Mono hanging ?
+
+
+How often does this happen? 
+Always (at least on my box)
+
+
+Additional Information:
+This doesn't happen if the numbers are lower (like /10).