Macos OSX10.9上的mono导致SQLite3崩溃的原因是什么?

Macos OSX10.9上的mono导致SQLite3崩溃的原因是什么?,macos,dll,sqlite,mono,stack-trace,Macos,Dll,Sqlite,Mono,Stack Trace,我试图使用mono运行的C#服务器应用程序(可以找到开发版本),它附带了一个sqlite3.dll库 但是,在连接了多个客户端的情况下运行服务器几分钟后,服务器应用程序将因以下Stacktrace而崩溃: Stacktrace: at <unknown> <0xffffffff> at (wrapper managed-to-native) System.Data.SQLite.UnsafeNativeMethods.sqlite3_prepare_v2 (in

我试图使用mono运行的C#服务器应用程序(可以找到开发版本),它附带了一个sqlite3.dll库

但是,在连接了多个客户端的情况下运行服务器几分钟后,服务器应用程序将因以下Stacktrace而崩溃:

Stacktrace:

  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) System.Data.SQLite.UnsafeNativeMethods.sqlite3_prepare_v2 (intptr,intptr,int,intptr&,intptr&) <0xffffffff>
  at System.Data.SQLite.SQLite3.Prepare (System.Data.SQLite.SQLiteConnection,string,System.Data.SQLite.SQLiteStatement,uint,string&) <0x003f3>
  at System.Data.SQLite.SQLiteCommand.BuildNextCommand () <0x001eb>
  at System.Data.SQLite.SQLiteCommand.GetStatement (int) <0x00023>
  at (wrapper remoting-invoke-with-check) System.Data.SQLite.SQLiteCommand.GetStatement (int) <0xffffffff>
  at System.Data.SQLite.SQLiteDataReader.NextResult () <0x0031f>
  at System.Data.SQLite.SQLiteDataReader..ctor (System.Data.SQLite.SQLiteCommand,System.Data.CommandBehavior) <0x00177>
  at (wrapper remoting-invoke-with-check) System.Data.SQLite.SQLiteDataReader..ctor (System.Data.SQLite.SQLiteCommand,System.Data.CommandBehavior) <0xffffffff>
  at System.Data.SQLite.SQLiteCommand.ExecuteReader (System.Data.CommandBehavior) <0x00047>
  at System.Data.SQLite.SQLiteCommand.ExecuteNonQuery () <0x00027>
  at KMPServer.Server.HandleUDPProbe (KMPServer.Client,byte[]) <0x00318>
  at KMPServer.Server.handleMessage (KMPServer.Client,KMPCommon/ClientMessageID,byte[]) <0x0022f>
  at KMPServer.Server.asyncUDPReceive (System.IAsyncResult) <0x0035f>
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void__this___object (object,intptr,intptr,intptr) <0xffffffff>
Stacktrace:
在
at(包装器管理为本机)System.Data.SQLite.unsafentivemethods.sqlite3\u prepare\u v2(intptr,intptr,int,intptr&,intptr&)
在System.Data.SQLite.SQLite3.Prepare(System.Data.SQLite.SQLiteConnection,string,System.Data.SQLite.SQLiteStatement,uint,string&)
在System.Data.SQLite.SQLiteCommand.BuildNextCommand()处
在System.Data.SQLite.SQLiteCommand.GetStatement处(int)
at(带检查的包装器远程调用)System.Data.SQLite.SQLiteCommand.GetStatement(int)
在System.Data.SQLite.SQLiteDataReader.NextResult()处
在System.Data.SQLite.SQLiteDataReader..ctor(System.Data.SQLite.SQLiteCommand,System.Data.CommandBehavior)
at(包装器远程处理调用检查)System.Data.SQLite.SQLiteDataReader..ctor(System.Data.SQLite.SQLiteCommand,System.Data.CommandBehavior)
位于System.Data.SQLite.SQLiteCommand.ExecuteReader(System.Data.CommandBehavior)
在System.Data.SQLite.SQLiteCommand.ExecuteOnQuery()处
位于KMPServer.Server.handleUpProbe(KMPServer.Client,字节[])
位于KMPServer.Server.handleMessage(KMPServer.Client,kmpcomon/ClientMessageID,字节[])
在KMPServer.Server.AsyncUDPrective(System.IAsyncResult)上
在(包装器运行时调用)运行时调用此对象(对象、intptr、intptr、intptr)
这里包括本机gbd stacktrace:


似乎在UDP代码中的某个地方,SQLite库崩溃了,这在windows上运行相同的代码时不会发生

国防部的开发人员建议尝试寻找不同的sqlite3绑定或库,但即使下载sqlite,在Mac上编译,然后使用生成的“libsqlite3.0.dylib”库,我仍然会遇到这个错误


这是否可能是Mono的直接问题?是什么导致了此问题,如何解决此问题?

使用以下调试变量运行mono:

export MONO_LOG_LEVEL=debug;
export MONO_LOG_MASK=dll; 
我发现,虽然mono能够看到我编译的动态库,但它没有加载,说明它是错误的体系结构

服务器可执行文件是32位的,当仅使用
/configure
从源代码编译sqlite时,生成的库只有64位

然后我试着只为32位编译它:

CFLAGS='-arch i686' LDFLAGS='-arch i686' ./configure --disable-dependency-tracking;
make;
生成的动态库已正确加载,似乎已修复了该问题。我不再像以前那样崩溃了



总之,无论出于何种原因,位于
/usr/lib/libsqlite3.dylib
的默认mac sqlib似乎会导致mono和我试图运行的可执行文件崩溃。编译我自己的32位版本解决了这个问题。

谢谢-也为我解决了这个问题。奇怪的是,我的控制台应用程序似乎很高兴地与64位SQLite库进行了几次对话,然后突然阻塞,直到我切换到一个自行编译的32位SQLite后才再次运行。。。