Mono 5.16 seems to have a problem with VRS 3.0.0 Beta

Bug reports and questions about running Virtual Radar Server on Linux
Post Reply
test123
Posts: 6
Joined: Fri Jul 07, 2017 8:15 pm

Mono 5.16 seems to have a problem with VRS 3.0.0 Beta

Post by test123 » Tue Oct 09, 2018 11:10 pm

Hi,

today my Raspberry Pi in my attic didn't respond, and I had to hard reboot it. Alas VRS din't restart, and I thought the reboot had broken a SQLite database.
But after running

sqlite3 "$1" "PRAGMA integrity_check"

on the main database and on every .sqb in ~/.local/share/VirtualRadar/, it still wouldn't start. Even moving away ~/.local/share/VirtualRadar/ and my database directory didn't help, it always crashed with something like this:

Code: Select all

/opt/VirtualRadar/VirtualRadar.exe -nogui -culture:de-DE
Parsing command-line parameters
Initialising the log
Unhandled Exception Caught
System.DivideByZeroException:                                                                                                      
  at (wrapper managed-to-native) System.Object.__icall_wrapper___emul_ldiv(long,long)                                              
  at System.DateTimeFormat.FormatCustomized (System.DateTime dateTime, System.String format, System.Globalization.DateTimeFormatInfo dtfi, System.TimeSpan offset) <0x749d6fa8 + 0x0075f> in <c3c5f4bb011a4af8b925b0d39ee12396>:0                                     
  at System.DateTimeFormat.Format (System.DateTime dateTime, System.String format, System.Globalization.DateTimeFormatInfo dtfi, System.TimeSpan offset) <0x749d9220 + 0x00227> in <c3c5f4bb011a4af8b925b0d39ee12396>:0                                               
  at System.DateTimeFormat.Format (System.DateTime dateTime, System.String format, System.Globalization.DateTimeFormatInfo dtfi) <0x749d9198 + 0x00073> in <c3c5f4bb011a4af8b925b0d39ee12396>:0                                                                       
  at System.DateTime.ToString (System.String format, System.IFormatProvider provider) <0x749be77c + 0x00067> in <c3c5f4bb011a4af8b925b0d39ee12396>:0                                                                                                                  
  at System.Text.StringBuilder.AppendFormatHelper (System.IFormatProvider provider, System.String format, System.ParamsArray args) <0x74bb998c + 0x00ac3> in <c3c5f4bb011a4af8b925b0d39ee12396>:0                                                                     
  at System.String.FormatHelper (System.IFormatProvider provider, System.String format, System.ParamsArray args) <0x7496ae68 + 0x00083> in <c3c5f4bb011a4af8b925b0d39ee12396>:0                                                                                       
  at System.String.Format (System.String format, System.Object arg0, System.Object arg1, System.Object arg2) <0x7496ab50 + 0x00057> in <c3c5f4bb011a4af8b925b0d39ee12396>:0                                                                                           
  at VirtualRadar.Library.Log.WriteLine (System.String message) [0x00069] in <c62bd1faa4734b0692f523fe22cf2279>:0                  
  at VirtualRadar.Library.Log.WriteLine (System.String format, System.Object[] args) [0x00008] in <c62bd1faa4734b0692f523fe22cf2279>:0                                                                                                                                
  at VirtualRadar.Library.Presenter.SplashPresenter.InitialiseLog (VirtualRadar.Interface.Settings.IConfigurationStorage configurationStorage) [0x0005d] in <c62bd1faa4734b0692f523fe22cf2279>:0                                                                      
  at VirtualRadar.Library.Presenter.SplashPresenter.StartApplication () [0x0000d] in <c62bd1faa4734b0692f523fe22cf2279>:0          
  at VirtualRadar.Headless.View.SplashView.ShowView () [0x00024] in <0b6289ac1b064632b3bd4e6867226f39>:0                           
  at VirtualRadar.Interface.ProgramLifetime.StartApplication (System.String[] args) [0x00023] in <29e9b72fce454a3e86dd0dac0dc82863>:0                                                                                                                                 
  at VirtualRadar.Interface.ProgramLifetime.SingleInstanceStart (System.String[] args) [0x00010] in <29e9b72fce454a3e86dd0dac0dc82863>:0                                                                                                                              
  at VirtualRadar.Program.Main (System.String[] args) [0x00059] in <7d020c021d8f41528d27ecb5bbdf56ab>:0                            

[ERROR] FATAL UNHANDLED EXCEPTION: System.DivideByZeroException                                                                    
  at (wrapper managed-to-native) System.Object.__icall_wrapper___emul_ldiv(long,long)                                              
  at System.DateTimeFormat.FormatCustomized (System.DateTime dateTime, System.String format, System.Globalization.DateTimeFormatInfo dtfi, System.TimeSpan offset) <0x749d6fa8 + 0x0075f> in <c3c5f4bb011a4af8b925b0d39ee12396>:0                                     
  at System.DateTimeFormat.Format (System.DateTime dateTime, System.String format, System.Globalization.DateTimeFormatInfo dtfi, System.TimeSpan offset) <0x749d9220 + 0x00227> in <c3c5f4bb011a4af8b925b0d39ee12396>:0                                               
  at System.DateTimeFormat.Format (System.DateTime dateTime, System.String format, System.Globalization.DateTimeFormatInfo dtfi) <0x749d9198 + 0x00073> in <c3c5f4bb011a4af8b925b0d39ee12396>:0                                                                       
  at System.DateTime.ToString (System.String format, System.IFormatProvider provider) <0x749be77c + 0x00067> in <c3c5f4bb011a4af8b925b0d39ee12396>:0                                                                                                                  
  at System.Text.StringBuilder.AppendFormatHelper (System.IFormatProvider provider, System.String format, System.ParamsArray args) <0x74bb998c + 0x00ac3> in <c3c5f4bb011a4af8b925b0d39ee12396>:0                                                                     
  at System.String.FormatHelper (System.IFormatProvider provider, System.String format, System.ParamsArray args) <0x7496ae68 + 0x00083> in <c3c5f4bb011a4af8b925b0d39ee12396>:0 
  at System.String.Format (System.String format, System.Object arg0, System.Object arg1, System.Object arg2) <0x7496ab50 + 0x00057> in <c3c5f4bb011a4af8b925b0d39ee12396>:0 
  at VirtualRadar.Library.Log.WriteLine (System.String message) [0x00069] in <c62bd1faa4734b0692f523fe22cf2279>:0 
  at VirtualRadar.Library.Log.WriteLine (System.String format, System.Object[] args) [0x00008] in <c62bd1faa4734b0692f523fe22cf2279>:0 
  at VirtualRadar.Library.Presenter.SplashPresenter.InitialiseLog (VirtualRadar.Interface.Settings.IConfigurationStorage configurationStorage) [0x0005d] in <c62bd1faa4734b0692f523fe22cf2279>:0 
  at VirtualRadar.Library.Presenter.SplashPresenter.StartApplication () [0x0000d] in <c62bd1faa4734b0692f523fe22cf2279>:0 
  at VirtualRadar.Headless.View.SplashView.ShowView () [0x00024] in <0b6289ac1b064632b3bd4e6867226f39>:0 
  at VirtualRadar.Interface.ProgramLifetime.StartApplication (System.String[] args) [0x00023] in <29e9b72fce454a3e86dd0dac0dc82863>:0 
  at VirtualRadar.Interface.ProgramLifetime.SingleInstanceStart (System.String[] args) [0x00010] in <29e9b72fce454a3e86dd0dac0dc82863>:0 
  at VirtualRadar.Program.Main (System.String[] args) [0x00059] in <7d020c021d8f41528d27ecb5bbdf56ab>:0 
In /var/log/dpkg.log I found that this morning Mono had been upgraded from 5.14.0.177-0xamarin3+raspbian9b1 to 5.16.0.179-0xamarin1+raspbian9b1.
Apparently I had added "deb https://download.mono-project.com/repo/debian stable-raspbianstretch main" to my apt sources (because newer is always better, I guess).

I commented that line out, removed about 175 Mono packages with Synaptic, installed mono-complete again (now 4.6.2.7+dfsg-1), and VRS ran happily again.
Maybe this post helps someone that stumbles into the same problem.

ssuttner
Posts: 6
Joined: Wed Dec 30, 2015 8:39 am
Contact:

Re: Mono 5.16 seems to have a problem with VRS 3.0.0 Beta

Post by ssuttner » Wed Oct 10, 2018 10:18 pm

There are also problems with the official Version 2.4.2 from 16th June 2018 and Mono: 5.16.0.179 (tarball Thu Oct 4 12:22:11 UTC 2018)
on Raspberry PI.

Starting VRS with GUI: mono /SDR/VRS/VirtualRadar.exe

Code: Select all

WARNING: The runtime version supported by this application is unavailable.
Using default runtime: v4.0.30319
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: The type initializer for 'System.Windows.Forms.XplatUI' threw an exception. ---> System.TypeInitializationException: The type initializer for 'System.Windows.Forms.Hwnd' threw an exception. ---> System.ArgumentOutOfRangeException: Load factor needs to be between 0.1 and 1.0.
Parameter name: loadFactor
  at System.Collections.Hashtable..ctor (System.Int32 capacity, System.Single loadFactor) <0x74d7cae8 + 0x001bc> in <c3c5f4bb011a4af8b925b0d39ee12396>:0 
  at System.Windows.Forms.Hwnd..cctor () [0x00000] in <50f22134ee3a4d3ab382d1d406dc2ad0>:0 
   --- End of inner exception stack trace ---
  at System.Windows.Forms.XplatUIX11.SetDisplay (System.IntPtr display_handle) [0x0013f] in <50f22134ee3a4d3ab382d1d406dc2ad0>:0 
  at System.Windows.Forms.XplatUIX11..ctor () [0x00077] in <50f22134ee3a4d3ab382d1d406dc2ad0>:0 
  at System.Windows.Forms.XplatUIX11.GetInstance () [0x00019] in <50f22134ee3a4d3ab382d1d406dc2ad0>:0 
  at System.Windows.Forms.XplatUI..cctor () [0x000c0] in <50f22134ee3a4d3ab382d1d406dc2ad0>:0 
   --- End of inner exception stack trace ---
  at System.Windows.Forms.Application.EnableVisualStyles () [0x00006] in <50f22134ee3a4d3ab382d1d406dc2ad0>:0 
  at VirtualRadar.Program.Main (System.String[] args) [0x0009f] in <2307358f05d74dc0b22c62fa357d9680>:0 
Starting VRS without GUI: mono /SDR/VRS/VirtualRadar.exe -nogui

Code: Select all

WARNING: The runtime version supported by this application is unavailable.
Using default runtime: v4.0.30319
Parsing command-line parameters
Initialising the log
Unhandled Exception Caught
System.DivideByZeroException: 
  at (wrapper managed-to-native) System.Object.__icall_wrapper___emul_ldiv(long,long)
  at System.DateTimeFormat.FormatCustomized (System.DateTime dateTime, System.String format, System.Globalization.DateTimeFormatInfo dtfi, System.TimeSpan offset) <0x749d6fa8 + 0x0075f> in <c3c5f4bb011a4af8b925b0d39ee12396>:0 
  at System.DateTimeFormat.Format (System.DateTime dateTime, System.String format, System.Globalization.DateTimeFormatInfo dtfi, System.TimeSpan offset) <0x749d9220 + 0x00227> in <c3c5f4bb011a4af8b925b0d39ee12396>:0 
  at System.DateTimeFormat.Format (System.DateTime dateTime, System.String format, System.Globalization.DateTimeFormatInfo dtfi) <0x749d9198 + 0x00073> in <c3c5f4bb011a4af8b925b0d39ee12396>:0 
  at System.DateTime.ToString (System.String format, System.IFormatProvider provider) <0x749be77c + 0x00067> in <c3c5f4bb011a4af8b925b0d39ee12396>:0 
  at System.Text.StringBuilder.AppendFormatHelper (System.IFormatProvider provider, System.String format, System.ParamsArray args) <0x74bb998c + 0x00ac3> in <c3c5f4bb011a4af8b925b0d39ee12396>:0 
  at System.String.FormatHelper (System.IFormatProvider provider, System.String format, System.ParamsArray args) <0x7496ae68 + 0x00083> in <c3c5f4bb011a4af8b925b0d39ee12396>:0 
  at System.String.Format (System.String format, System.Object arg0, System.Object arg1, System.Object arg2) <0x7496ab50 + 0x00057> in <c3c5f4bb011a4af8b925b0d39ee12396>:0 
  at VirtualRadar.Library.Log.WriteLine (System.String message) [0x00065] in <593bd3592c3a45e4b7d8cc75da2931cf>:0 
  at VirtualRadar.Library.Log.WriteLine (System.String format, System.Object[] args) [0x00008] in <593bd3592c3a45e4b7d8cc75da2931cf>:0 
  at VirtualRadar.Library.Presenter.SplashPresenter.InitialiseLog (VirtualRadar.Interface.Settings.IConfigurationStorage configurationStorage) [0x00050] in <593bd3592c3a45e4b7d8cc75da2931cf>:0 
  at VirtualRadar.Library.Presenter.SplashPresenter.StartApplication () [0x00017] in <593bd3592c3a45e4b7d8cc75da2931cf>:0 
  at VirtualRadar.Headless.View.SplashView.ShowView () [0x00029] in <0e568f91d2f041c2a8103d12f3d1e47c>:0 
  at VirtualRadar.Program.StartApplication (System.String[] args) [0x00028] in <2307358f05d74dc0b22c62fa357d9680>:0 
  at VirtualRadar.Program.Main (System.String[] args) [0x001cc] in <2307358f05d74dc0b22c62fa357d9680>:0 

[ERROR] FATAL UNHANDLED EXCEPTION: System.DivideByZeroException
  at (wrapper managed-to-native) System.Object.__icall_wrapper___emul_ldiv(long,long)
  at System.DateTimeFormat.FormatCustomized (System.DateTime dateTime, System.String format, System.Globalization.DateTimeFormatInfo dtfi, System.TimeSpan offset) <0x749d6fa8 + 0x0075f> in <c3c5f4bb011a4af8b925b0d39ee12396>:0 
  at System.DateTimeFormat.Format (System.DateTime dateTime, System.String format, System.Globalization.DateTimeFormatInfo dtfi, System.TimeSpan offset) <0x749d9220 + 0x00227> in <c3c5f4bb011a4af8b925b0d39ee12396>:0 
  at System.DateTimeFormat.Format (System.DateTime dateTime, System.String format, System.Globalization.DateTimeFormatInfo dtfi) <0x749d9198 + 0x00073> in <c3c5f4bb011a4af8b925b0d39ee12396>:0 
  at System.DateTime.ToString (System.String format, System.IFormatProvider provider) <0x749be77c + 0x00067> in <c3c5f4bb011a4af8b925b0d39ee12396>:0 
  at System.Text.StringBuilder.AppendFormatHelper (System.IFormatProvider provider, System.String format, System.ParamsArray args) <0x74bb998c + 0x00ac3> in <c3c5f4bb011a4af8b925b0d39ee12396>:0 
  at System.String.FormatHelper (System.IFormatProvider provider, System.String format, System.ParamsArray args) <0x7496ae68 + 0x00083> in <c3c5f4bb011a4af8b925b0d39ee12396>:0 
  at System.String.Format (System.String format, System.Object arg0, System.Object arg1, System.Object arg2) <0x7496ab50 + 0x00057> in <c3c5f4bb011a4af8b925b0d39ee12396>:0 
  at VirtualRadar.Library.Log.WriteLine (System.String message) [0x00065] in <593bd3592c3a45e4b7d8cc75da2931cf>:0 
  at VirtualRadar.Library.Log.WriteLine (System.String format, System.Object[] args) [0x00008] in <593bd3592c3a45e4b7d8cc75da2931cf>:0 
  at VirtualRadar.Library.Presenter.SplashPresenter.InitialiseLog (VirtualRadar.Interface.Settings.IConfigurationStorage configurationStorage) [0x00050] in <593bd3592c3a45e4b7d8cc75da2931cf>:0 
  at VirtualRadar.Library.Presenter.SplashPresenter.StartApplication () [0x00017] in <593bd3592c3a45e4b7d8cc75da2931cf>:0 
  at VirtualRadar.Headless.View.SplashView.ShowView () [0x00029] in <0e568f91d2f041c2a8103d12f3d1e47c>:0 
  at VirtualRadar.Program.StartApplication (System.String[] args) [0x00028] in <2307358f05d74dc0b22c62fa357d9680>:0 
  at VirtualRadar.Program.Main (System.String[] args) [0x001cc] in <2307358f05d74dc0b22c62fa357d9680>:0 
Please build VRS against the newest mono version

agw
Posts: 2130
Joined: Fri Feb 17, 2012 3:20 am

Re: Mono 5.16 seems to have a problem with VRS 3.0.0 Beta

Post by agw » Sun Oct 14, 2018 5:29 pm

I don't build against any mono version, old or new. I build against the common language runtime that mono has to implement correctly. If a particular version of mono isn't implementing the runtime correctly then there isn't much that I can do.

You might be able to work around the System.Windows.Forms issue by running VRS headless (install the web admin plugin and use the -nogui switch, see the Linux page on the site for details).

The divide by zero in DateTimeFormat.FormatCustomized is (as far as I can remember) a known issue in mono. You will need to either downgrade from that version of mono or wait for it to be fixed and then upgrade.

zardoz
Posts: 5
Joined: Sun Mar 04, 2018 5:13 pm

Re: Mono 5.16 seems to have a problem with VRS 3.0.0 Beta

Post by zardoz » Mon Oct 15, 2018 5:49 pm

Confirmed. I had to revert back to mono 5.14.0.177 in order for VRS 2.4.2 to run.
What a PITA that turned out to be.

agw
Posts: 2130
Joined: Fri Feb 17, 2012 3:20 am

Re: Mono 5.16 seems to have a problem with VRS 3.0.0 Beta

Post by agw » Mon Oct 15, 2018 10:45 pm

There is a possibility of moving version 3 over to .NET Core which basically ships the bits of .NET that the program uses with the program itself. It's cross platform for Windows, Linux and OSX. However, it doesn't include any graphics stuff so I would need to rewrite those bits and I would need a purely web-based front end for it. Maybe just the web admin plugin, maybe something else.

That's not going to happen soon though, for the time being you need to avoid or work around the versions of Mono that have bugs.

Post Reply