[Mono-bugs] [Bug 61134][Nor] New - GCHandle.AddrOfPinnedObject gives incorrect address for arrays

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sat, 3 Jul 2004 17:47:46 -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 mathpup@mylinuxisp.com.

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

--- shadow/61134	2004-07-03 17:47:46.000000000 -0400
+++ shadow/61134.tmp.10351	2004-07-03 17:47:46.000000000 -0400
@@ -0,0 +1,58 @@
+Bug#: 61134
+Product: Mono: Runtime
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: mathpup@mylinuxisp.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: GCHandle.AddrOfPinnedObject gives incorrect address for arrays
+
+Description of Problem: 
+ 
+When a GCHandle with GCHandleType.Pinned is created, it should be possible 
+to obtain the address of the object with GCHandle.AddrOfPinnedObject(). 
+When the object in question is an array, Mono appears to return a pointer 
+to some header information that preceeds the actual appear data. However, 
+Rotor returns a pointer to the first element of the array. See the 
+"Results" section below. 
+ 
+Steps to reproduce the problem: 
+1. gcc -shared -o libtest.so test.c 
+2. mcs test.cs 
+3. mono test.exe 
+ 
+Actual Results: 
+ 
+135270400 135270400 
+size of array[x]: 1 
+==> array(0) = 168 
+==> array(1) = 208 
+==> array(2) = 4 
+==> array(3) = 8 
+==> array(13) = 48 
+==> array(1998) = 1 
+==> array(1999) = 2 
+ 
+Expected Results: 
+ 
+1093363496 1093363496 
+size of array[x]: 1 
+==> array(1982) = 1 
+==> array(1983) = 2 
+ 
+ 
+How often does this happen?  
+ 
+Always 
+ 
+ 
+Additional Information: