[Mono-bugs] [Bug 78877][Nor] New - Can't assign to WeakReference.Target

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Mon Jul 17 07:27:50 EDT 2006


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 anto.cuni at gmail.com.

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

--- shadow/78877	2006-07-17 07:27:50.000000000 -0400
+++ shadow/78877.tmp.20720	2006-07-17 07:27:50.000000000 -0400
@@ -0,0 +1,97 @@
+Bug#: 78877
+Product: Mono: Runtime
+Version: 1.1
+OS: 
+OS Details: Linux anto 2.6.14.3 #2 PREEMPT Mon Dec 19 16:18:17 CET 2005 i686 Mobile AMD Athlon(tm) XP 3000+ AuthenticAMD GNU/Linux
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: GC
+AssignedTo: lupus at ximian.com                            
+ReportedBy: anto.cuni at gmail.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Can't assign to WeakReference.Target
+
+Description of Problem:
+
+The runtime crashes when trying to assign the Target field of a WeakReference.
+
+Steps to reproduce the problem:
+
+Compile & execute the following code:
+
+using System;
+class MyClass{ }
+class Test
+{
+    static void Main(string[] argv)
+    {
+        WeakReference refe = new WeakReference(null);
+        refe.Target = new MyClass();
+        MyClass obj = (MyClass)refe.Target;
+    }
+}
+
+Actual Results:
+
+=================================================================
+Got a SIGSEGV while executing native code. This usually indicates
+a fatal error in the mono runtime or one of the native libraries 
+used by your application.
+=================================================================
+
+Stacktrace:
+
+in (wrapper managed-to-native)
+System.Runtime.InteropServices.GCHandle:GetTargetHandle
+(object,int,System.Runtime.InteropServices.GCHandleType) <0x4>
+in (wrapper managed-to-native)
+System.Runtime.InteropServices.GCHandle:GetTargetHandle
+(object,int,System.Runtime.InteropServices.GCHandleType) <0xa3>
+in System.Runtime.InteropServices.GCHandle:set_Target (object) <0x1b>
+in System.WeakReference:set_Target (object) <0x13>
+in Test:Main (string[]) <0x46>
+in (wrapper runtime-invoke) System.Object:runtime_invoke_void_string[]
+(object,intptr,intptr,intptr) <0x50a03027>
+
+Native stacktrace:
+
+        mono(mono_handle_native_sigsegv+0xc3) [0x81487c3]
+        mono [0x8134c16]
+        /lib/libpthread.so.0 [0x4c54f81b]
+        [0xffffe440]
+        mono [0x814aa09]
+        mono [0x814a3bc]
+        [0xb7731e6a]
+        [0xb7731ee4]
+        [0xb7731eac]
+        [0xb7731c67]
+        [0xb7731ac3]
+        mono [0x8134ac0]
+        mono(mono_runtime_invoke+0x27) [0x80cf647]
+        mono(mono_runtime_exec_main+0x5a) [0x80d05da]
+        mono(mono_runtime_run_main+0x19f) [0x80d026f]
+        mono [0x805d0a1]
+        mono(mono_main+0x812) [0x805da72]
+        mono [0x805c42b]
+        /lib/libc.so.6(__libc_start_main+0xb7) [0x4bc628a7]
+        mono [0x805c361]
+
+Expected Results:
+
+Nothing.
+
+How often does this happen? 
+
+Always.
+
+Additional Information:
+
+Tested on linux with Mono 1.1.13.4 and 1.1.15, and on Windows with
+1.1.13.8. It always crashes.
+
+With Microsoft CLR it works fine.


More information about the mono-bugs mailing list