[Mono-bugs] [Bug 38331][Nor] New - Error cleaning up after Main with +1 appdomain

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Wed, 19 Feb 2003 11:41:07 -0500 (EST)


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 gonzalo@ximian.com.

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

--- shadow/38331	Wed Feb 19 11:41:07 2003
+++ shadow/38331.tmp.25991	Wed Feb 19 11:41:07 2003
@@ -0,0 +1,52 @@
+Bug#: 38331
+Product: Mono/Runtime
+Version: unspecified
+OS: other
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: gonzalo@ximian.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Error cleaning up after Main with +1 appdomain
+
+Compile and run this test program:
+-------------
+using System;
+
+class C
+{
+	static void Main ()
+	{
+		AppDomain domain = AppDomain.CreateDomain ("another");
+		domain.DoCallBack (new CrossAppDomainDelegate (AnotherDomain));
+		domain.DomainUnload += new EventHandler (UnloadHandler);
+		AppDomain.Unload (domain);
+		Console.WriteLine ("After Unload");
+	}
+
+	public static void AnotherDomain ()
+	{
+		Console.WriteLine ("Domain: " + AppDomain.CurrentDomain.FriendlyName);
+	}
+
+	public static void UnloadHandler (object sender, EventArgs e)
+	{
+		Console.WriteLine ("Unloading: " + ((AppDomain) sender).FriendlyName);
+	}
+}
+
+-------------
+
+The output is fine:
+Domain: another
+Unloading: another
+After Unload
+
+But then the program receives a SIGILL.