trarck / csharp-sqlite

Automatically exported from code.google.com/p/csharp-sqlite
Other
0 stars 0 forks source link

Mono errors #128

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Compile database and SqliteClient and SqliteClientTests (works fine)
2. Run Test No. 1 using command "mono SqliteClientTests.exe"
3. Cry!

What is the expected output? What do you see instead?
Expected: Test runs as it does with .NET 3.5 and .NET 4.0, without errors. With 
mono, tests result in various errors.

What version of the product are you using? On what operating system?
Most recent csharp-sqlite (3.7.7.1) and most recent stable mono release 
(2.10.5).

Please provide any additional information below.
File locking requires native calls to some kernel32.dll functions. Removing 
these gets rid of some of the runtime errors, but SqliteClient Tests still do 
not work.

Original issue reported on code.google.com by michael....@gmail.com on 16 Sep 2011 at 2:04

GoogleCodeExporter commented 8 years ago
Have you contacted Miguel de Icaza at mono about this?  I forget the details, 
but there were some compiler flags he set to get it working.

He told me last March that it was working.  Maybe the 3.7.7.1 code set broke 
some things.  Did you try the 3.7.5 or 3.7.6 versions?

Original comment by market.n...@gmail.com on 16 Sep 2011 at 4:13

GoogleCodeExporter commented 8 years ago
It would be great to find out how to make it work. Michael, could you please 
report back your findings?

Original comment by Chezbox@gmail.com on 18 Sep 2011 at 1:09

GoogleCodeExporter commented 8 years ago
Problem is, I haven't got too much time on my hands right now, but I have quite 
an interest in getting this fixed, so if I make any progress I'll be sure to 
post it here.

Original comment by michael....@gmail.com on 18 Sep 2011 at 8:40

GoogleCodeExporter commented 8 years ago
Ok, I found out a few more things regarding this issue:

Firstly, once you remove all the compiler flags regarding multithreading, mutex 
and thread-safety, everything compiles and runs fine in Mono (I set the 
SQLITE_MUTEX_OMIT flag and deleted the SQLITE_MUTEX_W32 and SQLITE_THREADSAFE 
flags from the default configuration). So that's an improvement on the previous 
situation.

However Mono (and .NET of course) provide platform-independent ways for locking 
and thread-safety, so it should be no problem to implement the W32-specific 
mutexes that are in use now in a platform-independent manner.

So in my eyes this Defect should be marked as either NoAction or Verified and a 
new Enhancement issue created for implementing multi-threading in a .NET-only 
way. Afaik Thread-Safety classes are also available in the .NET Compact 
Framework and Silverlight, so a .NET-only implementation would also bring 
thread safety to those two, besides Mono.

Original comment by michael....@gmail.com on 19 Sep 2011 at 8:38

GoogleCodeExporter commented 8 years ago
Thank you, would you be able to write up a WIKI page for Compiling with Mono.  

Original comment by noah.hart@gmail.com on 19 Sep 2011 at 8:53

GoogleCodeExporter commented 8 years ago
Yeah, I can do that. However I probably won't find enough time before the 
weekend...

Original comment by michael....@gmail.com on 22 Sep 2011 at 11:48

GoogleCodeExporter commented 8 years ago
Has compilation on Mono (on OS X) been described anywhere?  Was pretty easy to 
get it to compile, but bombs at test one for me.  Fraid I'm new enough to 
MonoDevelop not to know much about compiler flags either, though I'll start 
Googling now.

Running Test 1 on Mono on OS X:

Test1 Start.
Create connection...
Set connection String: Version=3,uri=file:SqliteTest31.db
Symbol file 
/Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/gac/System.Core/3.5.
0.0__b77a5c561934e089/System.Core.dll.mdb doesn't match image 
/Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/gac/System.Core/3.5.
0.0__b77a5c561934e089/System.Core.dll
Open database...
create command...
create table TEST_TABLE...

Unhandled Exception: System.EntryPointNotFoundException: LockFileEx
  at (wrapper managed-to-native) Community.CsharpSqlite.Sqlite3/LockingStrategy:LockFileEx (intptr,uint,uint,uint,uint,System.Threading.NativeOverlapped&)
  at Community.CsharpSqlite.Sqlite3+LockingStrategy.SharedLockFile (Community.CsharpSqlite.sqlite3_file pFile, Int64 offset, Int64 length) [0x00041] in /Users/rufbo/Documents/monoProjs/csharp-sqlite/Community.CsharpSqlite/src/os_win_c.cs:3703 
... 

Original comment by rufw...@gmail.com on 2 May 2012 at 1:17

GoogleCodeExporter commented 8 years ago
You might want to ask on the Google group

http://groups.google.com/group/csharp-sqlite

Original comment by noah.hart@gmail.com on 2 May 2012 at 1:28

GoogleCodeExporter commented 8 years ago
Believe I'm reading your post on it now... Looks like I might have to email 
Xamarin.  Thanks.

Original comment by rufw...@gmail.com on 2 May 2012 at 1:36