[Mono-bugs] [Bug 54980][Maj] Changed - AppDomain.Unload() fails randomly

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Fri, 5 Mar 2004 10:51:47 -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 jaak@zd.com.pl.

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

--- shadow/54980	2004-03-05 08:01:05.000000000 -0500
+++ shadow/54980.tmp.12616	2004-03-05 10:51:47.000000000 -0500
@@ -89,6 +89,92 @@
 
 On MS.net, how long does the finalization code take (/me wonders how 
 to test).
 
 ------- Additional Comments From vargaz@freemail.hu  2004-03-05 08:01 -------
 The patch is in CVS.
+
+------- Additional Comments From jaak@zd.com.pl  2004-03-05 10:51 -------
+I've made some additional research with this trivial case:
+
+1. I've modified "mono/metadata/gc.c" to print some debugging
+information, basically by adding "printf()" before and after the call
+to "Finalize" (around line 100)
+
+2. I've ran the testcase multiple times. Looks like it hangs on
+"Runner" class finalizer. I've traced the class down to "Timer.cs" in
+corlib.
+
+3. What is interesting, that when it hangs, it hangs fast:
+
+=========================================
+testValue: 3
+Finalize run on 0x94fc0b0 System.Globalization.CompareInfo
+Finalize finished
+Finalize run on 0x9512630 System.Threading.AutoResetEvent
+Finalize finished
+Finalize run on 0x9507000 .Runner
+(hangs here...)
+==========================================
+
+When it runs fine, it prints much more:
+
+==========================================
+testValue: 3
+Finalize run on 0x886c0b0 System.Globalization.CompareInfo
+Finalize finished
+Finalize run on 0x887df38 System.LocalDataStoreSlot
+Finalize finished
+Finalize run on 0x8882660 System.Threading.Timer
+Finalize finished
+Finalize run on 0x88825e8 System.Threading.ManualResetEvent
+Finalize finished
+Finalize run on 0x8887f60 System.Threading.Thread
+Finalize finished
+Finalize run on 0x87351a0 System.Reflection.Module
+Finalize finished
+Finalize run on 0x8882630 System.Threading.AutoResetEvent
+Finalize finished
+Finalize run on 0x8877000 .Runner
+Finalize finished
+Finalize run on 0x86d6cc0 System.Globalization.CompareInfo
+Finalize finished
+Finalize run on 0x86c8e70 System.Reflection.Emit.ModuleBuilder
+Finalize finished
+Finalize run on 0x881b300 System.Reflection.Module
+Finalize finished
+Finalize run on 0x856bf00 System.Threading.Thread
+Finalize finished
+Finalize run on 0x8572fa0 System.LocalDataStoreSlot
+Finalize finished
+Finalize run on 0x8833c00 System.Runtime.Remoting.Proxies.RemotingProxy
+Finalize finished
+Finalize run on 0x8829910 System.IO.FileStream
+Finalize finished
+Finalize run on 0x8821bd0 System.IO.StreamWriter
+Finalize finished
+Finalize run on 0x856bea0 System.Threading.Thread
+Finalize finished
+Finalize run on 0x8565360 System.Runtime.Remoting.Proxies.RemotingProxy
+Finalize finished
+Finalize run on 0x8821c08 System.IO.StreamWriter
+Finalize finished
+Finalize run on 0x86402c0 System.WeakReference
+Finalize finished
+Finalize run on 0x8821c40 System.IO.StreamWriter
+Finalize finished
+Finalize run on 0x8829960 System.IO.FileStream
+Finalize finished
+Finalize run on 0x882bba0 System.WeakReference
+Finalize finished
+Finalize run on 0x856a9a0 System.Reflection.Emit.ModuleBuilder
+Finalize finished
+Finalize run on 0x86409f0 System.Globalization.CompareInfo
+Finalize finished
+Finalize run on 0x88299b0 System.IO.FileStream
+Finalize finished
+==========================================
+
+4. It hangs on a call to wait.Set(); in Runner.Dispose(bool). 
+
+5. Looks like some deadlock. I'll keep investigating it. Maybe someone
+has an idea?