[Mono-bugs] [Bug 79273][Wis] New - mcs crashes when the source code references an unsupported Culture name

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Mon Sep 4 08:56:03 EDT 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 bruno at clisp.org.


--- shadow/79273	2006-09-04 08:56:03.000000000 -0400
+++ shadow/79273.tmp.27651	2006-09-04 08:56:03.000000000 -0400
@@ -0,0 +1,95 @@
+Bug#: 79273
+Product: Mono: Compilers
+Version: 1.1
+OS Details: 
+Status: NEW   
+Priority: Wishlist
+Component: C#
+AssignedTo: rharinath at novell.com                            
+ReportedBy: bruno at clisp.org               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+Summary: mcs crashes when the source code references an unsupported Culture name
+Please fill in this template when reporting a bug, unless you know what 
+you are doing.
+Description of Problem:
+mcs crashes when the input source contains a marker of the form
+[assembly: System.Reflection.AssemblyCulture("ga")]
+Steps to reproduce the problem:
+1. $ mkdir -p ga
+2. $ mcs -target:library -out:ga/hello-csharp.resources.dll resset.cs
+where resset.cs is this:
+============================ resset.cs =============================
+/* Automatically generated by GNU msgfmt.  Do not modify!  */
+[assembly: System.Reflection.AssemblyCulture("ga")]
+public class __UESCAPED__hello_u002dcsharp_ga {
+  private System.Collections.Hashtable Table;
+  public __UESCAPED__hello_u002dcsharp_ga () {
+  }
+  public void ReadResources () {
+    if (Table == null)
+      Table = new System.Collections.Hashtable();
+    System.Collections.Hashtable t = Table;
+    t.Add("Hello, world!","Dia duit, a dhomhain!");
+  }
+Actual Results:
+Unhandled Exception: System.ArgumentException: Culture name ga is not 
+Parameter name: name
+  at System.Globalization.CultureInfo..ctor (System.String name, Boolean 
+use_user_override) [0x00000] 
+  at System.Globalization.CultureInfo..ctor (System.String name) [0x00000] 
+  at System.Reflection.Emit.AssemblyBuilder.DefineVersionInfoResource () 
+  at Mono.CSharp.Driver.MainDriver (System.String[] args) [0x00000] 
+  at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] 
+Expected Results:
+No exception.
+How often does this happen? 
+Additional Information:
+GNU msgfmt invokes the 'mcs' in order to convert a PO to a resource,
+like this.
+I think it's a mono bug because
+  - The crash didn't occur in earlier mono versions,
+  - It does not occur with the 'pnet' implementation (the cscc compiler),
+  - I'm only asking to _label_ an assembly with a certain locale / culture
+    name, not to execute any functionality _in_ the locale.
+I'd like to see this fixed because:
+  - GNU msgfmt needs to attach a culture name to its generated resources,
+    so that the strong name of different resources in the Global Assembly 
+    is different.
+  - GNU msgfmt must support an open, unlimited set of locales. People are
+    creating new locales constantly, from Luganda to Tatar. There will 
+    be locales in development that are not yet supported by the official
+    mono release.
+  - Other implementations of the CLR might support a culture that mono
+    doesn't. But resources are created to be run in _any_ CLR 
+  - The error hits during "make" or "make dist" of internationalized 
+    long before a user actually attempts to use the culture.

More information about the mono-bugs mailing list