Bugzilla – Bug 321982
mcs crashes when the source code references an unsupported Culture name
Last modified: 2007-09-15 21:24:23 UTC
---- Reported by bruno@clisp.org 2006-09-04 08:56:03 MST ---- 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 supported. 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 () [0x00000] 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? Reproducible. 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 Cache is different. - GNU msgfmt must support an open, unlimited set of locales. People are creating new locales constantly, from Luganda to Tatar. There will always 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 implementation. - The error hits during "make" or "make dist" of internationalized packages, long before a user actually attempts to use the culture. ---- Additional Comments From marek.safar@seznam.cz 2006-09-05 07:45:12 MST ---- A duplicate of #76765 ---- Additional Comments From miguel@ximian.com 2006-10-06 11:25:30 MST ---- Fixed in r66351. ---- Additional Comments From miguel@ximian.com 2006-10-06 11:26:17 MST ---- close Unknown bug field "cf_op_sys_details" encountered while moving bug <cf_op_sys_details>Linux/x86</cf_op_sys_details> Unknown bug field "cf_version_details" encountered while moving bug <cf_version_details>1.1.17</cf_version_details> Unknown operating system SUSE 9.0. Setting to default OS "Other".