[Mono-bugs] [Bug 77645][Blo] New - --aot does not handle properly FieldOffsetAttribute - result: failed compilation

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sun Feb 26 05:17:31 EST 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 infodate at aster.pl.


--- shadow/77645	2006-02-26 05:17:31.000000000 -0500
+++ shadow/77645.tmp.5251	2006-02-26 05:17:31.000000000 -0500
@@ -0,0 +1,54 @@
+Bug#: 77645
+Product: Mono: Runtime
+Version: 1.1
+OS: All
+OS Details: SUSE Linux 10 fully patched / WinXP PL SP2 fully patched
+Status: NEW   
+Priority: Blocker
+Component: JIT
+AssignedTo: lupus at ximian.com                            
+ReportedBy: infodate at aster.pl               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+Summary: --aot does not handle properly FieldOffsetAttribute - result: failed compilation
+Description of Problem:
+Mono runtime --aot option allows for compilation of managed assemblies to
+native code ahead of execution. Unfortunately when run on assembly which
+contains classes declared with StructLayout(LayoutKind.Explicit) and
+FieldOffset attributes pointing to the same offset for two reference types
+(identical ones with ExplicitLayout attributes) compilation fails with
+message: "Type (in my test case NGmp.Math.RandState) which has an
+[ExplicitLayout] attribute cannot have reference field at the same offset
+as another field. aborting ...". Surprisingly JIT compiler does not have
+any problems there and creates an instance of RandState providing access to
+all memebers even those with identical FieldOffset attribute values.
+Steps to reproduce the problem:
+1. Download NGmp library from
+2. run mono --aot NGmp.dll
+3. check errors
+Actual Results:
+Mono fails to compile assembly.
+Expected Results:
+Compilation should succed and should be consistent with Mono runtime JIT
+behaviour and .NET ngen and runtime behaviour (ngen compiles assembly
+How often does this happen? 
+Every time test is run.
+Additional information:
+Actually this bug prevents any performance gains for NGmp library (which
+goes after multiprecision performance) and thus makes it less useful for
+Mono environment.

More information about the mono-bugs mailing list