Bug 321982 (MONO79273) - mcs crashes when the source code references an unsupported Culture name
Summary: mcs crashes when the source code references an unsupported Culture name
Status: RESOLVED FIXED
Alias: MONO79273
Product: Mono: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: 1.1
Hardware: Other Other
: P3 - Medium : Enhancement
Target Milestone: ---
Assignee: Raja R Harinath
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords: I18N
Depends on:
Blocks:
 
Reported: 2006-09-04 15:56 UTC by Bruno Haible
Modified: 2007-09-15 21:24 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 20:08:41 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".