[Mono-bugs] [Bug 58558][Blo] Changed - static constructors don't get called

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Mon, 17 May 2004 18:50:02 -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 gonzalo@ximian.com.

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

--- shadow/58558	2004-05-17 17:22:27.000000000 -0400
+++ shadow/58558.tmp.14185	2004-05-17 18:50:02.000000000 -0400
@@ -92,6 +92,42 @@
 
 fails. I confirmed that in the former case the .cctor gets called
 properly in a child domain while in the latter case it isn't called at
 all.
 
 IMHO This suggests some nasty assembly-sharing JIT bug.
+
+------- Additional Comments From gonzalo@ximian.com  2004-05-17 18:50 -------
+Revert this patch and try to run xsp. I hit the same bug:
+----------
+Index: ConfigurationSettings.cs
+===================================================================
+RCS file:
+/cvs/public/mcs/class/System/System.Configuration/ConfigurationSettings.cs,v
+retrieving revision 1.35
+retrieving revision 1.36
+diff -u -d -r1.35 -r1.36
+--- ConfigurationSettings.cs    6 May 2004 00:10:42 -0000       1.35
++++ ConfigurationSettings.cs    17 May 2004 20:34:32 -0000      1.36
+@@ -78,17 +78,17 @@
+                static DefaultConfig instance;
+                ConfigurationData config;
+ 
+-               static DefaultConfig ()
+-               {
+-                       instance = new DefaultConfig ();
+-               }
+-
+                private DefaultConfig ()
+                {
+                }
+ 
+                public static DefaultConfig GetInstance ()
+                {
++                       lock (typeof (DefaultConfig)) {
++                               if (instance == null)
++                                       instance = new DefaultConfig ();
++                       }
++
+                        return instance;
+                }
+-------------