[Mono-bugs] [Bug 62263][Nor] New - invalid pointer array access

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Mon, 2 Aug 2004 04:34:31 -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 overmind@gmx.net.

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

--- shadow/62263	2004-08-02 04:34:31.000000000 -0400
+++ shadow/62263.tmp.22006	2004-08-02 04:34:31.000000000 -0400
@@ -0,0 +1,45 @@
+Bug#: 62263
+Product: Mono: Compilers
+Version: unspecified
+OS: SLES 8
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: C#
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: overmind@gmx.net               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: invalid pointer array access
+
+Description of Problem:
+When I access a C-style array of structs using a pointer in an unsafe
+context, the pointer gets incremented by exactly 4 byte, not by the size of
+the array.
+
+Steps to reproduce the problem:
+1. compile my sample code from the attachment
+2. compare the output of the windows compiled executable with the output of
+the mono compiled executable
+
+Actual Results:
+3
+ptr[1].a = 3 overwrites the value at ptr[0].b
+
+Expected Results:
+2
+ptr[0].b is initially assigned 2, and this should not be changed by the
+following code
+
+How often does this happen? 
+always
+
+Additional Information:
+I attached a tarball containing the source code to reproduce the bug
+(bug.cs) and two assemblies, one compiled with mcs, one with csc on
+windows. The windows assembly runs correctly on both platforms, the mono
+assembly fails on both platforms.