[Mono-devel-list] patch for crash in locales.c (on cygwin), s econd try

Urs Muff umuff at QUARK.com
Wed Apr 21 19:43:17 EDT 2004


Did you validate that?  Do you have a win box to test?

I still get a crash doing 'mcs --version'
umuff at URSMUFF-TABLET:/go-mono.com> mcs --version

Unhandled Exception: System.TypeInitializationException: An exception was
thrown by the type initializer for Sys
tem.Console ---> System.Reflection.TargetInvocationException: Exception has
been thrown by the target of an invo
cation. ---> System.NullReferenceException: Object reference not set to an
instance of an object
in (unmanaged) (wrapper managed-to-native) System.Char:ToLower
(char,System.Globalization.CultureInfo)
in <0x00004> (wrapper managed-to-native) System.Char:ToLower
(char,System.Globalization.CultureInfo)
in <0x000aa> System.Collections.CaseInsensitiveHashCodeProvider:GetHashCode
(object)
in <0x00037> System.Collections.Hashtable:GetHash (object)
in <0x00050> System.Collections.Hashtable:Find (object)
in <0x0000e> System.Collections.Hashtable:Contains (object)
in <0x0008f> I18N.Common.Manager:LoadInternalClasses ()
in <0x00050> I18N.Common.Manager:LoadClassList ()
in <0x00099> I18N.Common.Manager:.ctor ()
in <0x00048> I18N.Common.Manager:get_PrimaryManager ()
in (unmanaged) (wrapper managed-to-native)
System.Reflection.MonoMethod:InternalInvoke (object,object[])
in <0x00004> (wrapper managed-to-native)
System.Reflection.MonoMethod:InternalInvoke (object,object[])
in <0x00077> System.Reflection.MonoMethod:Invoke
(object,System.Reflection.BindingFlags,System.Reflection.Binder
,object[],System.Globalization.CultureInfo)
--- End of inner exception stack trace ---

in <0x000b3> System.Reflection.MonoMethod:Invoke
(object,System.Reflection.BindingFlags,System.Reflection.Binder
,object[],System.Globalization.CultureInfo)
in <0x005e3> System.MonoType:InvokeMember
(string,System.Reflection.BindingFlags,System.Reflection.Binder,object
,object[],System.Reflection.ParameterModifier[],System.Globalization.Culture
Info,string[])
in <0x0016d> System.Text.Encoding:InvokeI18N (string,object[])
in <0x0017f> System.Text.Encoding:GetEncoding (string)
in <0x0005b> System.Text.Encoding:get_Default ()
in <0x0005b> System.Console:.cctor ()
--- End of inner exception stack trace ---

in (unmanaged) System.Console:WriteLine (string,object)
in <0x0003d> Mono.CSharp.Driver:Version ()
in <0x00613> Mono.CSharp.Driver:UnixParseOption (string,string[]&,int&)
in <0x00401> Mono.CSharp.Driver:MainDriver (string[])
in <0x0001a> Mono.CSharp.Driver:Main (string[])


Here is some more info:

umuff at URSMUFF-TABLET:/go-mono.com> gdb --args mono
c:/cygwin/go-mono.com/install/lib/mcs.exe --version
GNU gdb 2003-09-20-cvs (cygwin-special)
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-cygwin"...
(gdb) r
Starting program: /go-mono.com/install/bin/mono.exe
c:/cygwin/go-mono.com/install/lib/mcs.exe --version

Program received signal SIGSEGV, Segmentation fault.
[Switching to thread 3956.0x9f4]
ves_icall_System_Char_InternalToLower_Comp (c=67, cult=0x0) at
locales.c:1602
1602            if(cult->lcid==0x007F) {
(gdb) bt
#0  ves_icall_System_Char_InternalToLower_Comp (c=67, cult=0x0) at
locales.c:1602
#1  0x012da16e in ?? ()
#2  0x00000043 in ?? ()

- Urs

-----Original Message-----
From: mono-devel-list-admin at lists.ximian.com
[mailto:mono-devel-list-admin at lists.ximian.com] On Behalf Of Lluis Sanchez
Sent: Wednesday, April 21, 2004 5:33 PM
To: mono-devel-list at lists.ximian.com
Subject: Re: [Mono-devel-list] patch for crash in locales.c (on cygwin),
second try

Hi,

It was a bug in CaseInsensitiveHashCodeProvider, which assumed that
Char.ToLower could take null as culture. The fix is now in cvs.

Lluis.

On dc, 2004-04-21 at 23:46, Urs Muff wrote:
> Index: locales.c
> ===================================================================
> RCS file: /cvs/public/mono/mono/metadata/locales.c,v
> retrieving revision 1.16
> diff -u -r1.16 locales.c
> --- locales.c   21 Apr 2004 14:58:37 -0000      1.16
> +++ locales.c   21 Apr 2004 21:08:17 -0000
> @@ -1434,10 +1434,10 @@
>  #endif
> 
>  #ifdef DEBUG
> -       g_message (G_GNUC_PRETTY_FUNCTION ": LCID is %d", cult->lcid);
> +       g_message (G_GNUC_PRETTY_FUNCTION ": LCID is %d", cult == NULL ?
-1
> : cult->lcid);
>  #endif
> 
> -       if(cult->lcid==0x007F) {
> +       if(cult == NULL || cult->lcid==0x007F) {
>  #ifdef DEBUG
>                 g_message (G_GNUC_PRETTY_FUNCTION
>                            ": Invariant, using shortcut");
> @@ -1503,10 +1503,10 @@
>  #endif
> 
>  #ifdef DEBUG
> -       g_message (G_GNUC_PRETTY_FUNCTION ": LCID is %d", cult->lcid);
> +       g_message (G_GNUC_PRETTY_FUNCTION ": LCID is %d", cult == NULL ?
-1
> : cult->lcid);
>  #endif
> 
> -       if(cult->lcid==0x007F) {
> +       if(cult == NULL || cult->lcid==0x007F) {
>  #ifdef DEBUG
>                 g_message (G_GNUC_PRETTY_FUNCTION
>                            ": Invariant, using shortcut");
> @@ -1567,7 +1567,7 @@
> 
>         MONO_ARCH_SAVE_REGS;
> 
> -       if(cult->lcid==0x007F) {
> +       if(cult == NULL || cult->lcid==0x007F) {
>                 /* Invariant shortcut */
>                 return g_unichar_toupper (c);
>         }
> @@ -1599,7 +1599,7 @@
> 
>         MONO_ARCH_SAVE_REGS;
> 
> -       if(cult->lcid==0x007F) {
> +       if(cult == NULL || cult->lcid==0x007F) {
>                 /* Invariant shortcut */
>                 return g_unichar_tolower (c);
>         }
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list

_______________________________________________
Mono-devel-list mailing list
Mono-devel-list at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list



More information about the Mono-devel-list mailing list