GMap on linux

Topics: Bugs
May 2, 2012 at 8:54 AM
Edited May 2, 2012 at 8:57 AM

I am getting Lock violation exeption ...

I am using Suse 12.1 and Mono 2.10.6 installed mono Winforms

Any suggests ?

Thnks.

 

Unhandled Exception: System.IO.IOException: Lock violation on path /home/mkan/Desktop/s/TileDBv5/en/Data.gmdb
  at System.IO.FileStream.Lock (Int64 position, Int64 length) [0x00000] in <filename unknown>:0
  at GMap.NET.CacheProviders.SQLitePureImageCache.CheckPreAllocation () [0x00000] in <filename unknown>:0
  at GMap.NET.CacheProviders.SQLitePureImageCache.set_CacheLocation (System.String value) [0x00000] in <filename unknown>:0
  at GMap.NET.Internals.Cache.set_CacheLocation (System.String value) [0x00000] in <filename unknown>:0
  at GMap.NET.Internals.Cache..ctor () [0x00000] in <filename unknown>:0
  at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&)
  at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.IO.IOException: Lock violation on path /home/mkan/Desktop/s/TileDBv5/en/Data.gmdb
  at System.IO.FileStream.Lock (Int64 position, Int64 length) [0x00000] in <filename unknown>:0
  at GMap.NET.CacheProviders.SQLitePureImageCache.CheckPreAllocation () [0x00000] in <filename unknown>:0
  at GMap.NET.CacheProviders.SQLitePureImageCache.set_CacheLocation (System.String value) [0x00000] in <filename unknown>:0
  at GMap.NET.Internals.Cache.set_CacheLocation (System.String value) [0x00000] in <filename unknown>:0
  at GMap.NET.Internals.Cache..ctor () [0x00000] in <filename unknown>:0
  at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&)
  at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0

Coordinator
May 2, 2012 at 9:03 AM

it's fixed in last changeset, SQLitePureImageCache.CheckPreAllocation:

#if (!PocketPC && !MONO)
dbf.Lock(16, 2);
dbf.Read(pageSizeBytes, 0, 2);
dbf.Unlock(16, 2);

dbf.Seek(36, SeekOrigin.Begin);

dbf.Lock(36, 4);
dbf.Read(freePagesBytes, 0, 4);
dbf.Unlock(36, 4);
#else
dbf.Read(pageSizeBytes, 0, 2);
dbf.Seek(36, SeekOrigin.Begin);
dbf.Read(freePagesBytes, 0, 4);
#endif 

May 3, 2012 at 1:40 PM

Ok.

I will give a try immediately.

Thanks 

Mk.

Coordinator
May 3, 2012 at 1:48 PM

and change MONO_disabled to MONO in compilation symbols

Jul 8, 2012 at 4:06 PM

hi

Coordinator,

I also face with same problem like that in linux suse:

Unhandled Exception: System.IO.IOException: Lock violation on path /home/mkan/Desktop/s/TileDBv5/en/Data.gmdb

i've tried as u said (changed MONO_disabled to MONO in GMap.NET.WindowsForms but still same error occured. how can i do?

pls help me

thx

mm

Jul 10, 2012 at 5:18 PM

The Solution is
1. in Demo.WindowsForm I changed the compilation value "MONO_disabled" to "MONO". 

2. In GMap.Net.Core, I changed the compilation value "MONO_disabled" to "MONO" aslo.
   Then error occoured "The name 'busy' does not exist in the current context....".
 
3. I changed the two variables
    Int32 busy = 0;
    Int32 readCount = 0;
 as global declaration in "FastReaderWriterLock.cs"
 then compiled the solution again.
4. Run the Demo.WindowsForms.exe in folder bin then it works on Linux.

but i got another problem

Another problem is no data for map type provider in combo
1. I comment in MainForm.cs not to check the condition
    #if !MONO
    #endif

then I compiled and run on Linux. When I run the executable file, it doesn't work and some errors occurs :

System.InvalidCastException: Cannot cast from source type to destination type.
  at (wrapper managed-to-native) object:__icall_wrapper_mono_object_castclass (object,intptr)
  at System.Reflection.MonoProperty.GetterAdapterFrame[EmptyProvider,String] (System.Reflection.Getter`2 getter, System.Object obj) [0x00000] in <filename unknown>:0
  at System.Reflection.MonoProperty.GetValue (System.Object obj, System.Object[] index) [0x00000] in <filename unknown>:0
  at System.ComponentModel.ReflectionPropertyDescriptor.GetValue (System.Object component) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.ListControl.FilterItemOnProperty (System.Object item, System.String field) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.ListControl.GetItemText (System.Object item) [0x00000] in <filename unknown>:0
  at (wrapper remoting-invoke-with-check) System.Windows.Forms.ListControl:GetItemText (object)
  at System.Windows.Forms.ThemeWin32Classic.DrawComboBoxItem (System.Windows.Forms.ComboBox ctrl, System.Windows.Forms.DrawItemEventArgs e) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.ComboBox.HandleDrawItem (System.Windows.Forms.DrawItemEventArgs e) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.ComboBox.Draw (Rectangle clip, System.Drawing.Graphics dc) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.ComboBox.OnPaintInternal (System.Windows.Forms.PaintEventArgs pevent) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.Control.WmPaint (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.ComboBox.WndProc (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.Control+ControlWindowTarget.OnMessage (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.Control+ControlNativeWindow.WndProc (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.NativeWindow.WndProc (IntPtr hWnd, Msg msg, IntPtr wParam, IntPtr lParam) [0x00000] in <filename unknown>:0

 

so psl guide me how to solve this

thx

mm

Coordinator
Jul 16, 2012 at 3:40 PM

i guess mono team still hasn't fixed this