[Mono-bugs] [Bug 81254][Wis] New - [SPARC] Throws NRE on unaligned members in structures (e.g. Pack=2)

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Wed Mar 28 10:55:24 EDT 2007

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 sebastien at ximian.com.


--- shadow/81254	2007-03-28 09:55:24.000000000 -0500
+++ shadow/81254.tmp.23704	2007-03-28 09:55:24.000000000 -0500
@@ -0,0 +1,51 @@
+Bug#: 81254
+Product: Mono: Runtime
+Version: 1.2
+OS: All
+OS Details: Solaris and Linux
+Status: NEW   
+Priority: Wishlist
+Component: JIT
+AssignedTo: lupus at ximian.com                            
+ReportedBy: sebastien at ximian.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+Summary: [SPARC] Throws NRE on unaligned members in structures (e.g. Pack=2)
+Description of Problem:
+A structure used for metafile headers has a misaligned integer in it.
+[StructLayout (LayoutKind.Sequential, Pack=2)]
+internal struct WmfMetaHeader {
+	public short file_type;
+	public short header_size;
+	public short version;
+	// this is unaligned and fails on the SPARC architecture
+	public int file_size;
+	public short num_of_objects;
+	public int max_record_size;
+	public short num_of_params;
+Using them throw NRE.
+Steps to reproduce the problem:
+1. Declare structure 
+2. Assign value to file_size
+Actual Results:
+NRE on SPARC arch.
+Expected Results:
+No NRE (like other archs)
+How often does this happen? 
+Additional Information:
+- I can work around this, either permanently or temporarily, in C#;

More information about the mono-bugs mailing list