[Mono-osx] Systematic crash on launch of WinForm app

jdmuys jdmuys at mac.com
Fri May 23 04:32:53 EDT 2008


Hi,

I have been getting a systematic crash on launch of any WinForm application
under MacOS X Leopard, even a very simple "Hello World" app.

After much hair pulling, I managed to find out that the crash happens when
the format for floating point numbers includes a floating-coma, instead of a
floating point.

Could somebody confirm it by reproducing the bug, following these steps:

- Open System Preferences, and the International panel.
- Go to the "Formats" pane
- Select the French Format (if you have a submenu, select France)
- close the System Preferences and Open a new terminal window (important:
any previously open terminal window will still have the old format settings)
- launch any WinForm app
- Watch it crash
- Restore your previous Formats setting in the System Preferences.

Probably other settings than French(France) will make it crash too.

The workaround: If it hurts when I push here, then don't push here. Namely:
make sure you have United States selected in the Formats System Preference.

The fix: will have to occur in Mono, possibly in the System.Windows module.

Here is some output from the terminal:

$ mono --trace=T:System.Double WHello.exe

[first few hundred trace lines omitted]

Method System.Int32:ToString (string,System.IFormatProvider) emitted at
0x17ea6968 to 0x17ea699b (code length 51) [WHello.exe]
Method System.NumberFormatter:NumberToString
(string,int,System.Globalization.NumberFormatInfo) emitted at 0x17ea69b8 to
0x17ea69fd (code length 69) [WHello.exe]
Method System.Diagnostics.StackFrame:GetFileName () emitted at 0x17ea6a00 to
0x17ea6a90 (code length 144) [WHello.exe]
Method System.Diagnostics.StackFrame:GetFileLineNumber () emitted at
0x17ea6aa0 to 0x17ea6aae (code length 14) [WHello.exe]
Method System.Text.StringBuilder:AppendFormat (string,object,object) emitted
at 0x17ea6ab0 to 0x17ea6b14 (code length 100) [WHello.exe]
Method System.Diagnostics.StackFrame:GetInternalMethodName () emitted at
0x17ea6b18 to 0x17ea6b26 (code length 14) [WHello.exe]
Method System.Reflection.MethodBase:get_IsGenericMethod () emitted at
0x17ea6b28 to 0x17ea6b32 (code length 10) [WHello.exe]
Method System.Reflection.MonoCMethod:get_DeclaringType () emitted at
0x17ea6b38 to 0x17ea6b69 (code length 49) [WHello.exe]
Method System.Reflection.MonoCMethod:get_Name () emitted at 0x17ea6b70 to
0x17ea6b97 (code length 39) [WHello.exe]

Unhandled Exception: System.FormatException: Unknown char: .
  at System.Double.Parse (System.String s, NumberStyles style,
IFormatProvider provider) [0x00016] in
/private/tmp/monobuild/build/BUILD/mono-1.9.1/mcs/class/corlib/System/Double.cs:214 
  at System.Double.Parse (System.String s) [0x00000] in
/private/tmp/monobuild/build/BUILD/mono-1.9.1/mcs/class/corlib/System/Double.cs:182 
  at System.Convert.ToDouble (System.String value) [0x00010] in
/private/tmp/monobuild/build/BUILD/mono-1.9.1/mcs/class/corlib/System/Convert.cs:979 
  at System.Windows.Forms.XplatUICarbon.GetMessage (System.Object queue_id,
System.Windows.Forms.MSG& msg, IntPtr hWnd, Int32 wFilterMin, Int32
wFilterMax) [0x000a1] in
/private/tmp/monobuild/build/BUILD/mono-1.9.1/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUICarbon.cs:1333 
  at System.Windows.Forms.XplatUI.GetMessage (System.Object queue_id,
System.Windows.Forms.MSG& msg, IntPtr hWnd, Int32 wFilterMin, Int32
wFilterMax) [0x00000] in
/private/tmp/monobuild/build/BUILD/mono-1.9.1/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUI.cs:696 
  at System.Windows.Forms.Application.RunLoop (Boolean Modal,
System.Windows.Forms.ApplicationContext context) [0x003ad] in
/private/tmp/monobuild/build/BUILD/mono-1.9.1/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Application.cs:861 
  at System.Windows.Forms.Form.ShowDialog (IWin32Window ownerWin32)
[0x000f8] in
/private/tmp/monobuild/build/BUILD/mono-1.9.1/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs:1767 
  at System.Windows.Forms.Form.ShowDialog () [0x00000] in
/private/tmp/monobuild/build/BUILD/mono-1.9.1/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs:1692 
  at System.Windows.Forms.MessageBox+MessageBoxForm.RunDialog () [0x00034]
in
/private/tmp/monobuild/build/BUILD/mono-1.9.1/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MessageBox.cs:189 
  at (wrapper remoting-invoke-with-check) MessageBoxForm:RunDialog ()
  at System.Windows.Forms.MessageBox.Show (System.String text) [0x0000f] in
/private/tmp/monobuild/build/BUILD/mono-1.9.1/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MessageBox.cs:519 
  at HelloWorld..ctor () [0x00000] 
  at (wrapper remoting-invoke-with-check) HelloWorld:.ctor ()
  at HelloWorld.Main () [0x00000] 

$ mono --version
Mono JIT compiler version 1.9.1 (tarball)
Copyright (C) 2002-2007 Novell, Inc and Contributors. www.mono-project.com
	TLS:           normal
	GC:            Included Boehm (with typed GC)
	SIGSEGV:       normal
	Notification:  Thread + polling
	Architecture:  x86
	Disabled:      none


-- 
View this message in context: http://www.nabble.com/Systematic-crash-on-launch-of-WinForm-app-tp17420683p17420683.html
Sent from the Mono - OSX mailing list archive at Nabble.com.



More information about the Mono-osx mailing list