Monotouch和Sqlite错误

时间:2011-08-17 14:34:51

标签: sqlite xamarin.ios

Hy,

有时,不是在特定时刻,我的应用程序会破坏此消息。

Mprotect failed at 0x4f2f000 (length 12288) with errno 12
Stacktrace:

at Mono.Data.Sqlite.SqliteConvert.UTF8ToString (intptr,int) <0x000af>
at Mono.Data.Sqlite.SQLite3.GetText (Mono.Data.Sqlite.SqliteStatement,int) <0x00037>
at Mono.Data.Sqlite.SQLite3.GetValue (Mono.Data.Sqlite.SqliteStatement,int,Mono.Data.Sqlite.SQLiteType) <0x0047b>
at Mono.Data.Sqlite.SqliteDataReader.GetValue (int) <0x0009f>
at Mono.Data.Sqlite.SqliteDataReader.GetValues (object[]) <0x00057>
at TestLibertatea2.LocalDb.Query (string,Mono.Data.Sqlite.SqliteParameter[]) [0x0008c] in /Users/admin/Projects/TestLibertatea2/TestLibertatea2/Backend/Database/LocalDb.cs:68
at TestLibertatea2.LocalDb.QueryAsList (string,string,Mono.Data.Sqlite.SqliteParameter[]) [0x00006] in /Users/admin/Projects/TestLibertatea2/TestLibertatea2/Backend/Database/LocalDb.cs:85
at TestLibertatea2.LocalDb.QueryAsList (string,string) [0x00000] in /Users/admin/Projects/TestLibertatea2/TestLibertatea2/Backend/Database/LocalDb.cs:79
at TestLibertatea2.DbArticol.GetDbList (string) [0x00006] in /Users/admin/Projects/TestLibertatea2/TestLibertatea2/Backend/DbArticol.cs:37
at TestLibertatea2.HomePage.loadData () [0x00048] in /Users/admin/Projects/TestLibertatea2/TestLibertatea2/Controllers/HomePage.cs:105
at TestLibertatea2.HomePage.<ViewDidAppear>m__5 () [0x00000] in /Users/admin/Projects/TestLibertatea2/TestLibertatea2/Controllers/HomePage.cs:76
at MonoTouch.Foundation.NSActionDispatcher.Apply () <0x0002b>
at (wrapper runtime-invoke) object.runtime_invoke_dynamic (intptr,intptr,intptr,intptr) <0xffffffff>
at MonoTouch.UIKit.UIApplication.Main (string[],string,string) <0x000cf>
at MonoTouch.UIKit.UIApplication.Main (string[]) <0x00023>
at TestLibertatea2.Application.Main (string[]) [0x00000] in /Users/admin/Projects/TestLibertatea2/TestLibertatea2/Main.cs:17
at (wrapper runtime-invoke) object.runtime_invoke_dynamic (intptr,intptr,intptr,intptr) <0xffffffff>

原生堆栈跟踪:

0   TestLibertatea2                     0x005bc51c mono_handle_native_sigsegv + 412
1   TestLibertatea2                     0x005e3708 sigabrt_signal_handler + 148
2   libsystem_c.dylib                   0x36aeb72f _sigtramp + 42
3   libsystem_c.dylib                   0x36ae03bb pthread_kill + 58
4   libsystem_c.dylib                   0x36ad8bff abort + 78
5   TestLibertatea2                     0x0070f044 GC_remap + 200
6   TestLibertatea2                     0x00702a28 GC_allochblk_nth + 1536
7   TestLibertatea2                     0x007023d8 GC_allochblk + 96
8   TestLibertatea2                     0x00708d0c GC_alloc_large + 92
9   TestLibertatea2                     0x007093b0 GC_generic_malloc + 324
10  TestLibertatea2                     0x00709690 GC_malloc_atomic + 332
11  TestLibertatea2                     0x00695ab0 mono_object_allocate_ptrfree + 64
12  TestLibertatea2                     0x00695c1c mono_array_new_specific + 148
13  TestLibertatea2                     0x0050f34c wrapper_managed_to_native_object___icall_wrapper_mono_array_new_specific_intptr_int + 68
14  TestLibertatea2                     0x00349e30 Mono_Data_Sqlite_SQLite3_GetText_Mono_Data_Sqlite_SqliteStatement_int + 56
15  TestLibertatea2                     0x0034ac10 Mono_Data_Sqlite_SQLite3_GetValue_Mono_Data_Sqlite_SqliteStatement_int_Mono_Data_Sqlite_SQLiteType + 1148
16  TestLibertatea2                     0x00361f90 Mono_Data_Sqlite_SqliteDataReader_GetValue_int + 160
17  TestLibertatea2                     0x00361ff4 Mono_Data_Sqlite_SqliteDataReader_GetValues_object__ + 88
18  TestLibertatea2                     0x001a01e8 TestLibertatea2_LocalDb_Query_string_Mono_Data_Sqlite_SqliteParameter__ + 1288
19  TestLibertatea2                     0x001a0704 TestLibertatea2_LocalDb_QueryAsList_string_string_Mono_Data_Sqlite_SqliteParameter__ + 256
20  TestLibertatea2                     0x001a05b8 TestLibertatea2_LocalDb_QueryAsList_string_string + 200
21  TestLibertatea2                     0x001bca90 TestLibertatea2_DbArticol_GetDbList_string + 304
22  TestLibertatea2                     0x0018b494 TestLibertatea2_HomePage_loadData + 516
23  TestLibertatea2                     0x0018cdc8 TestLibertatea2_HomePage__ViewDidAppearm__5 + 128
24  TestLibertatea2                     0x0005f3bc MonoTouch_Foundation_NSActionDispatcher_Apply + 44
25  TestLibertatea2                     0x0050a498 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 200
26  TestLibertatea2                     0x005a2064 mono_jit_runtime_invoke + 2800
27  TestLibertatea2                     0x00690d38 mono_runtime_invoke + 140
28  TestLibertatea2                     0x00716928 monotouch_trampoline + 2840
29  Foundation                          0x35dca7cd __NSFireTimer + 136
30  CoreFoundation                      0x33538a47 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 14
31  CoreFoundation                      0x3353aecb __CFRunLoopDoTimer + 850
32  CoreFoundation                      0x3353b845 __CFRunLoopRun + 1088
33  CoreFoundation                      0x334cbec3 CFRunLoopRunSpecific + 230
34  CoreFoundation                      0x334cbdcb CFRunLoopRunInMode + 58
35  GraphicsServices                    0x3639641f GSEventRunModal + 114
36  GraphicsServices                    0x363964cb GSEventRun + 62
37  UIKit                               0x330e8d69 -[UIApplication _run] + 404
38  UIKit                               0x330e6807 UIApplicationMain + 670
39  TestLibertatea2                     0x0008c6fc wrapper_managed_to_native_MonoTouch_UIKit_UIApplication_UIApplicationMain_int_string___intptr_intptr + 240
40  TestLibertatea2                     0x0006af20 MonoTouch_UIKit_UIApplication_Main_string__ + 36
41  TestLibertatea2                     0x001847c8 TestLibertatea2_Application_Main_string__ + 128
42  TestLibertatea2                     0x0050a498 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 200
43  TestLibertatea2                     0x005a2064 mono_jit_runtime_invoke + 2800
44  TestLibertatea2                     0x00690d38 mono_runtime_invoke + 140
45  TestLibertatea2                     0x00693ce8 mono_runtime_exec_main + 784
46  TestLibertatea2                     0x00692d4c mono_runtime_run_main + 1048
47  TestLibertatea2                     0x005a9814 mono_jit_exec + 216
48  TestLibertatea2                     0x0059c620 main + 3616
49  TestLibertatea2                     0x000024a0 start + 52

来自gdb的调试信息:

2 个答案:

答案 0 :(得分:0)

你的内存不足。

 mmap errno 12 Cannot Allocate Memory

查看Explanation of MProtect Errno 12 (ENOMEM)iPhone application crashes with Mprotect failed error (MonoTouch)以查看一些可能的解决方法(例如尽可能使用IDisposable)。

答案 1 :(得分:0)

好的,在最后一个版本的monotouch(4.0.5)中,这个问题已经解决了。我的运气是它及时发布了!