[Mono-bugs] [Bug 22668] New - Error initializing a char []

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
28 Mar 2002 04:18:11 -0000


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=22668

--- shadow/22668	Wed Mar 27 23:18:11 2002
+++ shadow/22668.tmp.26757	Wed Mar 27 23:18:11 2002
@@ -0,0 +1,98 @@
+Bug#: 22668
+Product: Mono/Runtime
+Version: unspecified
+OS: other
+OS Details: Windows 2000 Pro
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: gonzalo@ximian.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Error initializing a char []
+
+Description of Problem:
+Initializing a static char [] with a value list enclosed in {} fails with
+System.ArgumentException causing the class not to be initialized
+(System.TypeInitializationException is thrown to the caller).
+
+
+Steps to reproduce the problem:
+1. Use version 1.6 of class/corlib/System/IntegerFormatter.cs in CVS.
+2. Remove the lines that exlude IntegerFormatter from the testing in
+class/corlib/Test/corlib_test.build
+3. Run the tests.
+4. In the output, look for IntegerFormatter. You can see that there's an
+error in the type initialization for IntegerFormatter.
+
+Note: I got 301 errors as of  March 28, 3:00 GMT+1
+
+Additional Information:
+
+Debugging the program i get this:
+---begin partial debugging session
+(cordbg) cont
+Warning: couldn't load symbols for
+c:\winnt\assembly\gac\system\1.0.3300.0__b77a5c561934e089\system.
+dll
+Warning: couldn't load symbols for c:\dvp\mcs\class\corlib\test\corlib_test.dll
+..First chance exception generated: (0x00bfe70c) <System.ArgumentException>
+...First chance exception generated: (0x00bfedb4)
+<System.Security.SecurityException>
+First chance exception generated: (0x00bfedb4)
+<System.Security.SecurityException>
+First chance exception generated: (0x00c03d04)
+<System.Reflection.TargetInvocationException>
+First chance exception generated: (0x00c03e5c) <NUnit.Framework.NUnitException>
+E.First chance exception generated: (0x00c04110) <System.ArgumentException>
+Unhandled exception generated: (0x00c04110) <System.ArgumentException>
+  m_paramName=<null>
+  _className=<null>
+  _exceptionMethod=<null>
+  _exceptionMethodString=<null>
+  _message=(0x00c04190) "Value does not fall within the expected range."
+  _innerException=<null>
+  _helpURL=<null>
+  _stackTrace=(0x00c04200) array with dims=[24]
+  _stackTraceString=<null>
+  _remoteStackTraceString=<null>
+  _remoteStackIndex=0x00000000
+  _HResult=0x80070057
+  _source=<null>
+  _xptrs=0x00000000
+  _xcode=0xe0434f4d
+
+098:            private static char[] digitLowerTable =
+(cordbg)
+
+---end partial debugging session
+
+In corlib/System/IntegerFormatter.cs we can see near the beggining of the
+class implementation:
+
+		private static char[] digitLowerTable = 
+       		{ '0', '1', '2', '3', '4', '5', '6', '7', 
+		  '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
+
+		private static char[] digitUpperTable = 
+		{ '0', '1', '2', '3', '4', '5', '6', '7', 
+		  '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
+
+I get the error when assigning value to digitLowerTable.
+I tried using 'new [16]', 'new []' between the '=' and the '{', but it
+still happens.
+
+Workaround:
+
+Finally I made a workaround (which I will commit when I finish this report)
+which uses a static constructor and assign the values for those two arrays
+in a couple of loops.
+
+Using the workaround, the number of failures when running the tests using
+out IntegerFormatter and adding  IntegerFormatterTests is 282 instead of
+301 without it.