2011-08-17 3 views
0

Hy,Ошибка Monotouch and Sqlite

Время от времени, а не в определенный момент, мое приложение подавляется с этим сообщением.

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> 

Родной StackTrace:

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 

Debug информация от GDB:

ответ

0

Хорошо, в последней версии monotouch (4.0.5) эта проблема решена. Мне повезло, что он был выпущен как раз вовремя!

0

Вы работаете из памяти.

mmap errno 12 Cannot Allocate Memory 

Посмотрите Explanation of MProtect Errno 12 (ENOMEM) и iPhone application crashes with Mprotect failed error (MonoTouch) видеть некоторые потенциальные обходной путь (например, с использованием IDisposable всякий раз, когда это возможно).

+0

И как я могу проверить свою память? Я использую таймер в своем navcontroller NSTimer.CreateRepeatingScheduledTimer (новый TimeSpan (0,0,1), delegate { Console.WriteLine (String.Format ("Mem: {0: 0,0}", GC.GetTotalMemory (false))); }); И все выглядит нормально, память не становится необычной, и она становится доступной. – Daniel

+0

«Число, которое является наилучшим доступным приближением количества байтов, в настоящее время распределенных в управляемой памяти». Ключевые слова: «аппроксимация» и «управляемая» (последний вызов стека с помощью IntPtr, скорее всего, представляет собой неуправляемую память). Ссылка: http://msdn.microsoft.com/en-us/library/system.gc.gettotalmemory.aspx Вы пытались переопределить ReceiveMemoryWarning (как предложено во второй ссылке)? – poupou

+0

Да, я переопределяю ReceiveMemoryWarning и его никогда не называли ... Это что-то странное - на симуляторе память не растет, когда я меняю текущий UIViewController, но на самом устройстве ipad память растет, и в одном из этой точки зрения появляется авария. – Daniel

Смежные вопросы