[Mono-bugs] [Bug 78776][Wis] New - Unexpected NullReferenceException with structs

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Thu Jul 6 14:26:07 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 jonpryor at vt.edu.


--- shadow/78776	2006-07-06 14:26:07.000000000 -0400
+++ shadow/78776.tmp.25330	2006-07-06 14:26:07.000000000 -0400
@@ -0,0 +1,72 @@
+Bug#: 78776
+Product: Mono: Runtime
+Version: 1.1
+OS: other
+OS Details: 
+Status: NEW   
+Priority: Wishlist
+Component: JIT
+AssignedTo: lupus at ximian.com                            
+ReportedBy: jonpryor at vt.edu               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+Summary: Unexpected NullReferenceException with structs
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+Tested with Mono
+The attached program generates a NullReferenceException when invoking
+static methods of a struct.
+Steps to reproduce the problem:
+1. Compile and run dzoe.cs:
+mcs -debug+ dzoe.cs
+mono --debug dzoe.exe
+Actual Results:
+Unhandled Exception: System.NullReferenceException: Object reference not
+set to an instance of an object
+in [0x0000d] (at
+System.String:memcpy4 (System.Byte* dest, System.Byte* src, Int32 size)
+in [0x0009f] (at
+System.String:memcpy (System.Byte* dest, System.Byte* src, Int32 size)in
+[0x00001] (at /export/home/pryorj/tmp/dzoe.cs:71) Test+Face:get_BoundingBox ()
+in [0x00072] (at /export/home/pryorj/tmp/dzoe.cs:84) Test:Main
+(System.String[] args)
+Expected Results:
+How often does this happen? 
+Additional Information:
+- Changing the `struct Face' into a `class Face' removes the
+- Changing Test.Face.get_BoundingBox from this:
+  Vector pos = Vector.Min(u, Vector.Min(v, w));
+to this:
+  Vector temp = Vector.Min(v,w);
+  Vector pos = Vector.Min(u, temp);
+removes the NullReferenceException.

More information about the mono-bugs mailing list