[Mono-bugs] [Bug 332163] New: Unloading AppDomain times out, then no more AppDomains ever unload

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Oct 9 09:17:04 EDT 2007


https://bugzilla.novell.com/show_bug.cgi?id=332163

           Summary: Unloading AppDomain times out, then no more AppDomains
                    ever unload
           Product: Mono: Runtime
           Version: 1.2
          Platform: PC
        OS/Version: RHEL 4
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: misc
        AssignedTo: mono-bugs at ximian.com
        ReportedBy: timh at ict.om.org
         QAContact: mono-bugs at ximian.com
                CC: christiank at ict.om.org
          Found By: Development


Created an attachment (id=177070)
 --> (https://bugzilla.novell.com/attachment.cgi?id=177070)
Testcase to be compiled and run

We first noticed this on our production application server where we create an
AppDomain for each client which connects and unload it when the client
disconnects.

We have created a small test-case (attached) which simply loads and unloads an
AppDomain many times in an infinate loop.

Using Microsoft dotNetFx 1.1 this seems to run indefinitely without error,
(over 100,000 AppDomains loaded and unloaded without any exceptions)

Using Mono 1.2.5.1 on Linux, we observe that an AppDomain can throw the
following exception when AppDomain.Unload is called on it:

** (testcase.exe:7467): WARNING **: Aborting of threads in domain
TypeGatheringDomain timed out.
System.CannotUnloadAppDomainException: Aborting of threads in domain
TypeGatheringDomain timed out.
  at <0x00000> <unknown method>
  at (wrapper managed-to-native) System.AppDomain:InternalUnload (int)
  at System.AppDomain.Unload (System.AppDomain domain) [0x00000]
  at AppDomainUnloadBug.Main () [0x00000]

I attach the output from the test-case.

We realize that this happens inevitably for us from time to time, and we
suspect that high CPU load can cause this. (We suspect that the hard-coded 10
second timeout in mono's AppDomain.Unload implementation may trigger this)

BUT once this has happened, new AppDomains may be created, and used, but they
then always throw the following exception when they are unloaded:

System.CannotUnloadAppDomainException: Finalization of domain
TypeGatheringDomain timed out.
  at <0x00000> <unknown method>
  at (wrapper managed-to-native) System.AppDomain:InternalUnload (int)
  at System.AppDomain.Unload (System.AppDomain domain) [0x00000]
  at AppDomainUnloadBug.Main () [0x00000]

The result is that the server slowly loses all it's memory to AppDomains which
can't be unloaded. Of course if the server run's out of memory this also
prevents the loading of new AppDomains.....

So once this bug occurs, AppDomains never unload again unless we restart our
server.


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list