[Mono-bugs] [Bug 61301][Blo] New - unexpected CG behavior

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Thu, 8 Jul 2004 14:36:49 -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 leandro@bol.com.br.

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

--- shadow/61301	2004-07-08 14:36:49.000000000 -0400
+++ shadow/61301.tmp.13569	2004-07-08 14:36:49.000000000 -0400
@@ -0,0 +1,99 @@
+Bug#: 61301
+Product: Mono: Runtime
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: Unknown
+Priority: Blocker
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: leandro@bol.com.br               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: unexpected CG behavior
+
+using System;
+using System.Threading;
+
+namespace TestCS
+{
+	class Base
+	{
+		public  Object o;
+	
+		public Base()
+		{		
+		}
+	
+		~Base() 
+		{	
+			Console.WriteLine(ToString());			
+		}
+
+	}
+
+	class A : Base
+	{		
+	}
+
+	class B : Base
+	{			
+	}
+
+
+	public class Test
+	{
+		public static void Main(string[] args)
+		{
+			A a = new A();
+			B b = new B();
+	
+			a.o = b;
+			b.o = a;
+	
+			a = null;
+			b = null;
+	
+			try
+			{	
+				System.GC.Collect();		
+				Console.WriteLine("System.GC.Collect()");
+
+				Thread.Sleep(2000);			
+			
+			} 
+			catch (Exception e)
+			{	
+				Console.WriteLine(e.Message);
+				Console.WriteLine(e.StackTrace);	
+			
+			}
+
+			Console.WriteLine("End");
+		}
+	}
+}
+
+
+Actual Results:
+System.GC.Collect()
+End
+TestCS.B
+
+Expected Results:
+System.GC.Collect()
+TestCS.B
+TestCS.A
+End
+
+
+
+How often does this happen? 
+
+ Just run.
+
+Additional Information: