[Mono-bugs] [Bug 75047][Blo] New - GC crashes on WeakReference(null)

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Wed May 25 18:32:27 EDT 2005


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 schaf at sheepsworld.com.

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

--- shadow/75047	2005-05-25 18:32:27.000000000 -0400
+++ shadow/75047.tmp.32266	2005-05-25 18:32:27.000000000 -0400
@@ -0,0 +1,79 @@
+Bug#: 75047
+Product: Mono: Runtime
+Version: unspecified
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Blocker
+Component: GC
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: schaf at sheepsworld.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: GC crashes on WeakReference(null)
+
+Description of Problem:
+The GC crashes if there are WeakReferences with Target null!
+
+Steps to reproduce the problem:
+1. compile 
+using System;
+
+public class TestCase
+{
+   public static void Main(string[] args)
+   {
+     WeakReference weak = new WeakReference(null);
+     GC.Collect();
+   }
+}
+ 
+
+Actual Results:
+crash
+
+trace returns:
+. . ENTER: System.WeakReference:.ctor
+(object)(this:0x8234fe0[System.WeakReference testcase.exe], (nil), )
+. . . ENTER: System.WeakReference:.ctor
+(object,bool)(this:0x8234fe0[System.WeakReference testcase.exe], (nil), 0, )
+. . . . ENTER: System.Object:.ctor ()(this:0x8234fe0[System.WeakReference
+testcase.exe], )
+. . . . LEAVE: System.Object:.ctor ()
+. . . . ENTER: System.WeakReference:AllocateHandle
+(object)(this:0x8234fe0[System.WeakReference testcase.exe], (nil), )
+. . . . . ENTER: System.Runtime.InteropServices.GCHandle:Alloc
+(object,System.Runtime.InteropServices.GCHandleType)(VALUERET:0xbf80f034,
+(nil), 0, )
+. . . . . . ENTER: System.Runtime.InteropServices.GCHandle:.ctor
+(object,System.Runtime.InteropServices.GCHandleType)(value:0xbf80f018,
+(nil), 0, )
+. . . . . . . ENTER: (wrapper managed-to-native)
+System.Runtime.InteropServices.GCHandle:GetTargetHandle
+(object,int,System.Runtime.InteropServices.GCHandleType)((nil), 0, 0, )
+. . . . . . . LEAVE: (wrapper managed-to-native)
+System.Runtime.InteropServices.GCHandle:GetTargetHandle
+(object,int,System.Runtime.InteropServices.GCHandleType)result=1
+. . . . . . LEAVE: System.Runtime.InteropServices.GCHandle:.ctor
+(object,System.Runtime.InteropServices.GCHandleType)
+. . . . . LEAVE: System.Runtime.InteropServices.GCHandle:Alloc
+(object,System.Runtime.InteropServices.GCHandleType)[01,00,00,00,]
+. . . . LEAVE: System.WeakReference:AllocateHandle (object)
+. . . LEAVE: System.WeakReference:.ctor (object,bool)
+. . LEAVE: System.WeakReference:.ctor (object)
+. . ENTER: System.GC:Collect ()()
+. . . ENTER: System.GC:get_MaxGeneration ()()
+. . . LEAVE: System.GC:get_MaxGeneration ()result=0
+. . . ENTER: (wrapper managed-to-native) System.GC:InternalCollect (int)(0, )
+
+Expected Results:
+no crash ;)
+
+How often does this happen? 
+everytime!
+
+Additional Information:


More information about the mono-bugs mailing list