插入很多行时Monotouch sqlite崩溃

时间:2013-06-10 09:44:47

标签: sqlite xamarin.ios

我是使用xamarin iOS构建的应用程序。数据库是sqlite。在模拟器和设备中,应用程序开始处理数据后,它会给我一个SIGSEGV错误。

堆栈跟踪:

at(wrapper managed-to-native)Mono.Data.Sqlite.UnsafeNativeMethods.sqlite3_prepare(intptr,intptr,int,intptr&,intptr&)   在/ Developer / MonoTouch / Source / mono / mcs / class中的Mono.Data.Sqlite.SQLite3.Prepare(Mono.Data.Sqlite.SqliteConnection,string,Mono.Data.Sqlite.SqliteStatement,uint,string&)[0x00044] /Mono.Data.Sqlite/Mono.Data.Sqlite_2.0/SQLite3.cs:268   在/Developer/MonoTouch/Source/mono/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite_2.0/SQLiteCommand.cs:230中的Mono.Data.Sqlite.SqliteCommand.BuildNextCommand()[0x00019]   在/Developer/MonoTouch/Source/mono/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite_2.0/SQLiteCommand.cs:264中的Mono.Data.Sqlite.SqliteCommand.GetStatement(int)[0x0000b]中   at(wrapper remoting-invoke-with-check)Mono.Data.Sqlite.SqliteCommand.GetStatement(int)   在/Developer/MonoTouch/Source/mono/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite_2.0/SQLiteDataReader.cs:896中的Mono.Data.Sqlite.SqliteDataReader.NextResult()[0x000cc]   在/Developer/MonoTouch/Source/mono/mcs/class/Mono.Data.Sqlite/Mono中的Mono.Data.Sqlite.SqliteDataReader..ctor(Mono.Data.Sqlite.SqliteCommand,System.Data.CommandBehavior)[0x00051] .Data.Sqlite_2.0 / SQLiteDataReader.cs:89   at(wrapper remoting-invoke-with-check)Mono.Data.Sqlite.SqliteDataReader..ctor(Mono.Data.Sqlite.SqliteCommand,System.Data.CommandBehavior)   在/Developer/MonoTouch/Source/mono/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite_2.0/SQLiteCommand中的Mono.Data.Sqlite.SqliteCommand.ExecuteReader(System.Data.CommandBehavior)[0x00006]。 CS:539   在/Developer/MonoTouch/Source/mono/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite_2.0/SQLiteCommand中的Mono.Data.Sqlite.SqliteCommand.ExecuteDbDataReader(System.Data.CommandBehavior)[0x00000]。 CS:527   在/Developer/MonoTouch/Source/mono/mcs/class/System.Data/System.Data.Common/DbCommand.cs:128中的System.Data.Common.DbCommand.ExecuteReader(System.Data.CommandBehavior)[0x00000]   /Developer/MonoTouch/Source/mono/mcs/class/System.Data/System.Data.Common/中的System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(System.Data.CommandBehavior)[0x00000] DbCommand.cs:145   在/Developer/MonoTouch/Source/mono/mcs/class/System.Data/中的System.Data.Common.DbDataAdapter.Fill(System.Data.DataTable,System.Data.IDbCommand,System.Data.CommandBehavior)[0x00022] System.Data.Common / DbDataAdapter.cs:297   在/Developer/MonoTouch/Source/mono/mcs/class/System.Data/System.Data.Common/DbDataAdapter.cs:273中的System.Data.Common.DbDataAdapter.Fill(System.Data.DataTable)[0x00011]   at(wrapper remoting-invoke-with-check)System.Data.Common.DbDataAdapter.Fill(System.Data.DataTable)   在PL.Dati.TabellaDati..ctor(PL.Dati.ConnessioneDB,string,string)[0x000e8] / Sviluppo / Librerie / Gestione Dati / PL.Dati.Mobile / Versioni / iOS / PL.Dati.iOS / TabellaDatiiOS。 CS:26   在PL.Dati.ConnessioneDB.EseguiSelezione(字符串)[0x00000] / Sviluppo / Librerie / Gestione Dati / PL.Dati.Mobile / Comune / ConnessioneDB.cs:206   at PL.Dati.ConnessioneDB.EseguiSelezione(string,string,string,bool,int,string [])[0x00137] in / Sviluppo / Librerie / Gestione Dati / PL.Dati.Mobile / Comune / ConnessioneDB.cs:192   at PLV.Dati.ConnessioneDB.EseguiSelezione(string,string,string,int)[0x00000] / Sviluppo / Librerie / Gestione Dati / PL.Dati.Mobile / Comune / ConnessioneDB.cs:125   at PL.Dati.ConnessioneDB.EseguiInserimentoTabellaDati(string,PL.Dati.TabellaDati,string [])[0x0004d] in / Sviluppo / Librerie / Gestione Dati / PL.Dati.Mobile / Comune / ConnessioneDB.cs:860   在PL.Dati.ConnessioneDB.EseguiInserimentoTabellaDati(string,PL.Dati.TabellaDati)[0x00000] / Sviluppo / Librerie / Gestione Dati / PL.Dati.Mobile / Comune / ConnessioneDB.cs:828   来自/Sviluppo /Procedure / iSell / Comune   at iSell.Core.GestioneTrasmissioni.ElaboraDatiDownload(bool)[0x002a0] in /Sviluppo/Procedure/iSell/Comune/Gestione/GestioneTrasmissioni.cs:888   来自/Sviluppo /Procedure / iSell / Comune   来自/Sviluppo /Procedure / iSell / Comune   at iSell.Core.GestoreInterfacciaTrasmissioni.RichiestaElaborazioneComando(string,object,object)[0x000c5] in /Sviluppo/Procedure/iSell/Comune/Interfacce/Client/GestoreInterfacciaTrasmissioni.cs:69   在iSell.Core.RicevitoreComandi.RichiediElaborazioneComando()[0x00036] in /Sviluppo/Procedure/iSell/Comune/EngineDati/RicevitoreComandi.cs:97   at iSell.Core.RicevitoreComandi.RichiediElaborazioneComando(object)[0x00007] in /Sviluppo/Procedure/iSell/Comune/EngineDati/RicevitoreComandi.cs:111   在iSell.Core.GestoreInterfacciaVisualizzazioneSorgenteDati.NotificaChiusuraInterfaccia(iSell.Core.GestioneInterfacce / TipiChiusuraInterfaccia)[0x00012] / Sviluppo / Procedure / iSell / Comune / Interfacce / Interazione utente / GestoreInterfacciaVisualizzazioneSorgenteDati.cs:54   在iSell.OS.ViewControllerStandard.ChiudiInterfaccia(iSell.Core.GestioneInterfacce / TipiChiusuraInterfaccia)[0x0009e] / Sviluppo / Procedure / iSell / Versioni / iSelliOS / iOS / Interfaccie / Classi ausiliarie / ViewControllerStandard.cs:319   at iSell.OS.ViewControllerStandard.ChiudiInterfaccia()[0x000a1] / Sviluppo / Procedure / iSell / Versioni / iSelliOS / iOS / Interfaccie / Classi ausiliarie / ViewControllerStandard.cs:277   位于/ Sviluppo / Procedure / iSell / Versioni / iSelliOS / iOS / Interfaccie / Classi ausiliarie / ViewControllerStandard.cs:   at iSell.Core.GestoreInterfacciaStandard.ChiudiInterfaccia()[0x0000b] in /Sviluppo/Procedure/iSell/Comune/Interfacce/Client/GestoreInterfacciaStandard.cs:77   来自/ Sviluppo / Procedure / iSell / Comune / Interfacce / Interazione utente / GestoreInterfacciaVisualizzazioneSorgenteDati.cs:39   at(wrapper delegate-invoke).invoke_void_ this SorgenteDati_IndiceElementoDati(PL.Dati.SorgenteDati,PL.Dati.IndiceElementoDati)   在PL.Dati.SorgenteDati.HandleIndiceElementoDatiCorrenteInSezioneModificato(PL.Dati.SezioneSorgenteDati,int)[0x00026] / Sviluppo / Librerie / Gestione Dati / PL.Dati.Mobile / Comune / SorgenteDati.cs:145   在PL.Dati.SezioneSorgenteDati.HandleIndiceElementoDatiCorrenteModificato(PL.Dati.SezioneSorgenteDati,int)[0x0000b]在/ Sviluppo / Librerie / Gestione Dati / PL.Dati.Mobile / Comune / SezioneSorgenteDati.cs:143   在PL.Dati.SezioneSorgenteDati.ImpostaIndiceElementoDatiCorrente(int,bool)[0x000e2] / Sviluppo / Librerie / Gestione Dati / PL.Dati.Mobile / Comune / SezioneSorgenteDati.cs:723   在PL.Dati.SorgenteDati.ImpostaIndiceElementoDatiCorrenteInSezione(int,int,bool)[0x00063] / Sviluppo / Librerie / Gestione Dati / PL.Dati.Mobile / Comune / SorgenteDati.cs:616   在PL.Dati.SorgenteDati.ImpostaIndiceElementoDatiCorrenteInSezione(int,int)[0x00000] / Sviluppo / Librerie / Gestione Dati / PL.Dati.Mobile / Comune / SorgenteDati.cs:594   在iSell.OS.SorgenteTableViewStandard.RowSelected(MonoTouch.UIKit.UITableView,MonoTouch.Foundation.NSIndexPath)[0x00000] / Sviluppo / Procedure / iSell / Versioni / iSelliOS / iOS / Interfaccie / Classi ausiliarie / SorgenteTableViewStandard.cs:298   at(wrapper runtime-invoke).runtime_invoke_void__this _object_object(object,intptr,intptr,intptr)   at(包装器托管到原生)MonoTouch.UIKit.UIApplication.UIApplicationMain(int,string [],intptr,intptr)   在/Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:38中的MonoTouch.UIKit.UIApplication.Main(string [],string,string)[0x0004c]   在/Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:43中的MonoTouch.UIKit.UIApplication.Main(string [])[0x00000]   at iSell.OS.Application.Main(string [])[0x00000] in /Sviluppo/Procedure/iSell/Versioni/iSelliOS/Main.cs:13   at(wrapper runtime-invoke).runtime_invoke_void_object(object,intptr,intptr,intptr)

原生堆栈跟踪:

0   iSell                               0x0007b09c mono_handle_native_sigsegv + 284
1   iSell                               0x00004f38 mono_sigsegv_signal_handler + 248
2   libsystem_c.dylib                   0x9c3ba59b _sigtramp + 43
3   ???                                 0xffffffff 0x0 + 4294967295
4   libsqlite3.dylib                    0x04284f81 sqlite3ExprAlloc + 257
5   libsqlite3.dylib                    0x04284a5b selectExpander + 2859
6   libsqlite3.dylib                    0x042817d8 sqlite3WalkSelect + 104
7   libsqlite3.dylib                    0x04280b0c sqlite3SelectPrep + 76
8   libsqlite3.dylib                    0x0426d448 sqlite3Select + 424
9   libsqlite3.dylib                    0x04261cdd yy_reduce + 8301
10  libsqlite3.dylib                    0x0425f535 sqlite3Parser + 245
11  libsqlite3.dylib                    0x042264ac sqlite3RunParser + 396
12  libsqlite3.dylib                    0x042a50fa sqlite3Prepare + 634
13  libsqlite3.dylib                    0x0422564e sqlite3LockAndPrepare + 270
14  libsqlite3.dylib                    0x04225205 sqlite3_prepare + 53
15  ???                                 0x19ef1687 0x0 + 435099271
16  ???                                 0x19ef0960 0x0 + 435095904
17  ???                                 0x19ef0455 0x0 + 435094613
18  ???                                 0x19ef0164 0x0 + 435093860
19  ???                                 0x19ef00e4 0x0 + 435093732
20  ???                                 0x19eefaa4 0x0 + 435092132
21  ???                                 0x19eef5f2 0x0 + 435090930
22  ???                                 0x19eef468 0x0 + 435090536
23  ???                                 0x19eee884 0x0 + 435087492
24  ???                                 0x19ef8ea8 0x0 + 435130024
25  ???                                 0x19ef8e63 0x0 + 435129955
26  ???                                 0x19ef8e10 0x0 + 435129872
27  ???                                 0x19ef8cab 0x0 + 435129515
28  ???                                 0x19ef8946 0x0 + 435128646
29  ???                                 0x19ef8864 0x0 + 435128420
30  ???                                 0x19ef7c40 0x0 + 435125312
31  ???                                 0x19ef76c4 0x0 + 435123908
32  ???                                 0x1a1c9c04 0x0 + 438082564
33  ???                                 0x1a1c9770 0x0 + 438081392
34  ???                                 0x1cb20058 0x0 + 481427544
35  ???                                 0x1cb1fd7c 0x0 + 481426812
36  ???                                 0x1c8c6610 0x0 + 478963216
37  ???                                 0x19e990e8 0x0 + 434737384
38  ???                                 0x19e9470c 0x0 + 434718476
39  ???                                 0x19e94494 0x0 + 434717844
40  ???                                 0x1c7dcd8c 0x0 + 478006668
41  ???                                 0x1c7dc8d8 0x0 + 478005464
42  ???                                 0x1c7dc7c8 0x0 + 478005192
43  ???                                 0x1c7dc6a8 0x0 + 478004904
44  ???                                 0x1c7db70b 0x0 + 478000907
45  ???                                 0x1c7dd755 0x0 + 478009173
46  ???                                 0x1c7dd4cf 0x0 + 478008527
47  ???                                 0x1c7dd46e 0x0 + 478008430
48  ???                                 0x1c7dd413 0x0 + 478008339
49  ???                                 0x1a1ef511 0x0 + 438236433
50  ???                                 0x1a1eef87 0x0 + 438235015
51  ???                                 0x1a1eeea6 0x0 + 438234790
52  ???                                 0x1a1eedcc 0x0 + 438234572
53  ???                                 0x1a1ee91c 0x0 + 438233372
54  ???                                 0x1a1ee740 0x0 + 438232896
55  ???                                 0x1a1ee34c 0x0 + 438231884
56  ???                                 0x1a1ee6dd 0x0 + 438232797
57  iSell                               0x00009282 mono_jit_runtime_invoke + 722
58  iSell                               0x00152a8e mono_runtime_invoke + 126
59  iSell                               0x00200ff6 monotouch_trampoline + 3686
60  UIKit                               0x019fb285 -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:] + 1194
61  UIKit                               0x019fb4ed -[UITableView _userSelectRowAtPendingSelectionIndexPath:] + 201
62  Foundation                          0x00a415b3 __NSFireDelayedPerform + 380
63  CoreFoundation                      0x03e81376 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 22
64  CoreFoundation                      0x03e80e06 __CFRunLoopDoTimer + 534
65  CoreFoundation                      0x03e68a82 __CFRunLoopRun + 1810
66  CoreFoundation                      0x03e67f44 CFRunLoopRunSpecific + 276
67  CoreFoundation                      0x03e67e1b CFRunLoopRunInMode + 123
68  GraphicsServices                    0x04e177e3 GSEventRunModal + 88
69  GraphicsServices                    0x04e17668 GSEventRun + 104
70  UIKit                               0x0194bffc UIApplicationMain + 1211
71  ???                                 0x0edecc8d 0x0 + 249482381
72  ???                                 0x0edec790 0x0 + 249481104
73  ???                                 0x0edec56c 0x0 + 249480556
74  ???                                 0x0edec3a4 0x0 + 249480100
75  ???                                 0x0edec516 0x0 + 249480470
76  iSell                               0x00009282 mono_jit_runtime_invoke + 722
77  iSell                               0x00152a8e mono_runtime_invoke + 126
78  iSell                               0x00156db4 mono_runtime_exec_main + 420
79  iSell                               0x00157125 mono_runtime_run_main + 725
80  iSell                               0x000641d5 mono_jit_exec + 149
81  iSell                               0x001f63a4 main + 1988
82  iSell                               0x00002be5 start + 53
83  ???                                 0x00000004 0x0 + 4

=============================================== ================== 执行本机代码时获得SIGSEGV。这通常表明 单声道运行时或其中一个本机库中的致命错误

由您的应用程序使用。

有人可以帮助我吗?

1 个答案:

答案 0 :(得分:1)

这可能是垃圾收集器的一个问题。 确保将SQLCommand和reader设置为null并设置为null。 看看这个: http://www.aaronheise.com/2012/12/monotouch-sqlite-sigsegv/#comment-10