[Mono-bugs] [Bug 59141][Wis] New - Mono seg fault on AppDomain.Unload

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 26 May 2004 18:18:29 -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 iseff@iseff.com.

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

--- shadow/59141	2004-05-26 18:18:29.000000000 -0400
+++ shadow/59141.tmp.20055	2004-05-26 18:18:29.000000000 -0400
@@ -0,0 +1,73 @@
+Bug#: 59141
+Product: Mono: Runtime
+Version: unspecified
+OS: GNU/Linux [Other]
+OS Details: Fedora Core 2
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: iseff@iseff.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Mono seg fault on AppDomain.Unload
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+Mono seems to be seg faulting on AppDomain.Unload for some unknown reason.
+This code works perfectly on Windows using csc.
+
+Steps to reproduce the problem:
+Use the following code (maybe with some modification) to see the seg fault
+when loading a .dll file into an appdomain.
+
+  public void LoadPlugins() {
+    int i = 1;
+    AppDomain newDom = AppDomain.CreateDomain("Domain: " + i);
+
+    ComponentInterfaceFactory factory = (ComponentInterfaceFactory)
+newDom.CreateInstance("ICGComponent", "ComponentInterfaceFactory").Unwrap();
+
+    object[] constructArgs = null;
+    string file = "testComponent.dll";
+    ICGComponent aComponent = factory.Create(file, "testComponent",
+constructArgs);
+
+
+    // test execute
+    aComponent.Process();
+
+    Console.WriteLine("right before unload");
+    AppDomain.Unload(newDom);
+    Console.WriteLine("right after unload");
+  }
+
+A ComponentInterfaceFactory is a very simple class with one method which
+just returns an ICGComponent using Activator.CreateInstanceFrom.
+
+The testComponent class obviously inherits from the ICGComponent interface.
+
+Actual Results:
+[iseff@gates server]$ mono Main.exe
+hello from testComponent Constructor
+helllllo from testComponent!
+right before unload
+Segmentation fault
+
+
+Expected Results:
+[iseff@gates server]$ mono Main.exe
+hello from testComponent Constructor
+helllllo from testComponent!
+right before unload
+right after unload
+
+How often does this happen? 
+Every time.
+
+Additional Information: