[Mono-bugs] [Bug 75793][Nor] New - Mono doesn't run interface cctors when accessing fields

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Fri Aug 12 06:06:02 EDT 2005

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 swhite-monobugs at decisionsoft.com.


--- shadow/75793	2005-08-12 06:06:02.000000000 -0400
+++ shadow/75793.tmp.5615	2005-08-12 06:06:02.000000000 -0400
@@ -0,0 +1,56 @@
+Bug#: 75793
+Product: Mono: Runtime
+Version: 1.1
+OS Details: 
+Status: NEW   
+Priority: Normal
+Component: misc
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: swhite-monobugs at decisionsoft.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+Summary: Mono doesn't run interface cctors when accessing fields
+This bug was originally filed against IKVM, see
+Description of Problem:
+The class constructor on an interface isn't run when fields are accessed.
+Steps to reproduce the problem:
+I don't think you can reproduce this using c# source, and my attempts to
+write some short IL assembler to reproduce it haven't succeeded.
+The following java (compiled to a java .class with Sun's javac, and then to
+a .NET exectuable using ikvmc) does demonstrate the problem, as does the
+other test program listed in the IKVM bug linked above.
+I can post the result of running 'monodis' on the resulting executable if
+required, but unfortunately this doesn't round-trip properly (i.e. the
+output of monodis can't then be compiled with ilasm).
+public class bad implements iBad {
+  public static void main(String[] argv) {
+    System.err.println(iBad.o);
+  }
+interface iBad {
+  public static final Object o = new Object();
+Actual Results:
+  Outputs 'null' when running the ikvmc compiled exectuable on Mono (tested
+under Mono and Mono
+Expected Results:
+  Outputs 'java.lang.Object at e1926e8' or similar when running the .class
+under Java, when running the .class under IKVM or when running the ikvmc
+compiled executable on .NET.

More information about the mono-bugs mailing list