I've found that I'm getting an error once I've deployed a solution to iPhone 4s which is causing the app to crash without raising any errors within MonoTouch. I'm handling the UIApplication.Main and writing to error log any exceptions, and none are being raised.
I've tracked it down to a line of code which I've deployed to iPad without this issue, the line is within the AppDelegate class:
[DllImport(MonoTouch.Constants.SystemLibrary)]
internal static extern int sysctlbyname( [MarshalAs(UnmanagedType.LPStr)] string property, IntPtr output, IntPtr oldLen, IntPtr newp, uint newlen);
It crashes the app out, but remains in the task list, rather than forcefully closing the whole app.
The Device Log on crashing is:
Mar 13 14:35:18 unknown UIKitApplication:come.redware-mobile.iphoneappstore[0x91f5][5456] <Notice>: Native stacktrace:
Mar 13 14:35:18 unknown UIKitApplication:come.redware-mobile.iphoneappstore[0x91f5][5456] <Notice>: 0 RWMAppStore 0x004917b4 RWMAppStore + 4786100
Mar 13 14:35:18 unknown UIKitApplication:come.redware-mobile.iphoneappstore[0x91f5][5456] <Notice>: 1 RWMAppStore 0x0047bde0 RWMAppStore + 4697568
Mar 13 14:35:18 unknown UIKitApplication:come.redware-mobile.iphoneappstore[0x91f5][5456] <Notice>: 2 libsystem_c.dylib 0x3620e539 _sigtramp + 48
Mar 13 14:35:18 unknown UIKitApplication:come.redware-mobile.iphoneappstore[0x91f5][5456] <Notice>: 3 RWMAppStore 0x004dd98c RWMAppStore + 5097868
Mar 13 14:35:18 unknown UIKitApplication:come.redware-mobile.iphoneappstore[0x91f5][5456] <Notice>: 4 RWMAppStore 0x004dd98c RWMAppStore + 5097868
Mar 13 14:35:18 unknown UIKitApplication:come.redware-mobile.iphoneappstore[0x91f5][5456] <Notice>: 5 RWMAppStore 0x00574a84 RWMAppStore + 5716612
Mar 13 14:35:18 unknown UIKitApplication:come.redware-mobile.iphoneappstore[0x91f5][5456] <Notice>: 6 RWMAppStore 0x004bdb40 RWMAppStore + 4967232
Mar 13 14:35:18 unknown UIKitApplication:come.redware-mobile.iphoneappstore[0x91f5][5456] <Notice>: 7 RWMAppStore 0x004de134 RWMAppStore + 5099828
Mar 13 14:35:18 unknown UIKitApplication:come.redware-mobile.iphoneappstore[0x91f5][5456] <Notice>: 8 RWMAppStore 0x005483a0 RWMAppStore + 5534624
Mar 13 14:35:18 unknown UIKitApplication:come.redware-mobile.iphoneappstore[0x91f5][5456] <Notice>: 9 RWMAppStore 0x00560764 RWMAppStore + 5633892
Mar 13 14:35:18 unknown UIKitApplication:come.redware-mobile.iphoneappstore[0x91f5][5456] <Notice>: 10 RWMAppStore 0x0057b034 RWMAppStore + 5742644
Mar 13 14:35:18 unknown UIKitApplication:come.redware-mobile.iphoneappstore[0x91f5][5456] <Notice>: 11 libsystem_c.dylib 0x361c5c1d _pthread_start + 320
Mar 13 14:35:18 unknown UIKitApplication:come.redware-mobile.iphoneappstore[0x91f5][5456] <Notice>: 12 libsystem_c.dylib 0x361c5ad8 thread_start + 8
Mar 13 14:35:18 unknown UIKitApplication:come.redware-mobile.iphoneappstore[0x91f5][5456] <Notice>: =================================================================
Mar 13 14:35:18 unknown UIKitApplication:come.redware-mobile.iphoneappstore[0x91f5][5456] <Notice>: Got a SIGSEGV while executing native code. This usually indicates
Mar 13 14:35:18 unknown UIKitApplication:come.redware-mobile.iphoneappstore[0x91f5][5456] <Notice>: a fatal error in the mono runtime or one of the native libraries
Mar 13 14:35:18 unknown UIKitApplication:come.redware-mobile.iphoneappstore[0x91f5][5456] <Notice>: used by your application.
Mar 13 14:35:18 unknown UIKitApplication:come.redware-mobile.iphoneappstore[0x91f5][5456] <Notice>: =================================================================
Mar 13 14:35:19 unknown ReportCrash[5458] <Notice>: Formulating crash report for process RWMAppStore[5456]
Mar 13 14:35:19 unknown com.apple.launchd[1] <Warning>: (UIKitApplication:come.redware-mobile.iphoneappstore[0x91f5]) Job appears to have crashed: Abort trap: 6
Mar 13 14:35:19 unknown SpringBoard[15] <Warning>: Application 'App Store Front' exited abnormally with signal 6: Abort trap: 6
The crash report is:
Incident Identifier: 49661917-C8E0-4FBB-9E21-1B9443B3443A
CrashReporter Key: 521c0afd53359e09a1e4eaae6ed1eda8500c4ebb
Hardware Model: iPhone4,1
Process: RWMAppStore [6537]
Path: /var/mobile/Applications/A2345805-B9C2-412E-BCEA-0A45D7CC7358/RWMAppStore.app/RWMAppStore
Identifier: RWMAppStore
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2012-03-14 13:53:06.552 +0000
OS Version: iPhone OS 5.0.1 (9A405)
Report Version: 104
Exception Type: EXC_BAD_ACCESS (SIGABRT)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000011d
Crashed Thread: 9
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0:
0 libsystem_kernel.dylib 0x33627010 0x33626000 + 4112
1 libsystem_kernel.dylib 0x33627206 0x33626000 + 4614
2 CoreFoundation 0x37d7141c 0x37ce4000 + 578588
3 CoreFoundation 0x37d7011a 0x37ce4000 + 573722
4 CoreFoundation 0x37cf34d6 0x37ce4000 + 62678
5 CoreFoundation 0x37cf339e 0x37ce4000 + 62366
6 GraphicsServices 0x37871fc6 0x3786e000 + 16326
7 UIKit 0x3518373c 0x35152000 + 202556
8 RWMAppStore 0x0023adf8 wrapper_managed_to_native_MonoTouch_UIKit_UIApplication_UIApplicationMain_int_string___intptr_intptr (monotouch.dll.6.s:33721)
9 RWMAppStore 0x00100b04 RWMAppStore_Application_Main_string__ (RWMAppStore.exe.6.s:21)
10 RWMAppStore 0x003d0d20 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr (mscorlib.dll.6.s:160144)
11 RWMAppStore 0x0047ddf8 mono_jit_runtime_invoke (mini.c:5786)
12 RWMAppStore 0x00525224 mono_runtime_invoke (object.c:2757)
13 RWMAppStore 0x005294d0 mono_runtime_exec_main (object.c:3932)
14 RWMAppStore 0x0052e144 mono_runtime_run_main (object.c:3562)
15 RWMAppStore 0x00482180 mono_jit_exec (driver.c:1112)
16 RWMAppStore 0x0047a3e4 main (main.m:1702)
17 RWMAppStore 0x00002730 0x1000 + 5936
Thread 1 name: Dispatch queue: com.apple.libdispatch-manager
Thread 1:
0 libsystem_kernel.dylib 0x336273b4 0x33626000 + 5044
1 libdispatch.dylib 0x37a5bf74 0x37a58000 + 16244
2 libdispatch.dylib 0x37a5bc92 0x37a58000 + 15506
Thread 2:
0 libsystem_kernel.dylib 0x33637cd4 0x33626000 + 72916
1 libsystem_c.dylib 0x361c030a 0x361b6000 + 41738
2 libsystem_c.dylib 0x361c009c 0x361b6000 + 41116
Thread 3:
0 libsystem_kernel.dylib 0x33637cd4 0x33626000 + 72916
1 libsystem_c.dylib 0x361c030a 0x361b6000 + 41738
2 libsystem_c.dylib 0x361c009c 0x361b6000 + 41116
Thread 4 name: WebThread
Thread 4:
0 libsystem_kernel.dylib 0x33627010 0x33626000 + 4112
1 libsystem_kernel.dylib 0x33627206 0x33626000 + 4614
2 CoreFoundation 0x37d7141c 0x37ce4000 + 578588
3 CoreFoundation 0x37d70154 0x37ce4000 + 573780
4 CoreFoundation 0x37cf34d6 0x37ce4000 + 62678
5 CoreFoundation 0x37cf339e 0x37ce4000 + 62366
6 WebCore 0x325c4128 0x3251c000 + 688424
7 libsystem_c.dylib 0x361c5c16 0x361b6000 + 64534
8 libsystem_c.dylib 0x361c5ad0 0x361b6000 + 64208
Thread 5:
0 libsystem_kernel.dylib 0x33637628 0x33626000 + 71208
1 libsystem_c.dylib 0x361c9ff2 0x361b6000 + 81906
2 RWMAppStore 0x0055f8f8 SleepEx (wthreads.c:1027)
3 RWMAppStore 0x0053f494 monitor_thread (threadpool.c:781)
4 RWMAppStore 0x00548398 start_wrapper (threads.c:784)
5 RWMAppStore 0x0056075c thread_start_routine (wthreads.c:287)
6 RWMAppStore 0x0057b02c GC_start_routine (pthread_support.c:1468)
7 libsystem_c.dylib 0x361c5c16 0x361b6000 + 64534
8 libsystem_c.dylib 0x361c5ad0 0x361b6000 + 64208
Thread 6:
0 libsystem_kernel.dylib 0x33627078 0x33626000 + 4216
1 RWMAppStore 0x0056708c mono_sem_timedwait (mono-semaphore.c:76)
2 RWMAppStore 0x005421a8 async_invoke_thread (threadpool.c:1497)
3 RWMAppStore 0x00548398 start_wrapper (threads.c:784)
4 RWMAppStore 0x0056075c thread_start_routine (wthreads.c:287)
5 RWMAppStore 0x0057b02c GC_start_routine (pthread_support.c:1468)
6 libsystem_c.dylib 0x361c5c16 0x361b6000 + 64534
7 libsystem_c.dylib 0x361c5ad0 0x361b6000 + 64208
Thread 7:
0 libsystem_kernel.dylib 0x336273b4 0x33626000 + 5044
1 RWMAppStore 0x005404dc tp_kqueue_wait (tpool-kqueue.c:98)
2 RWMAppStore 0x00548398 start_wrapper (threads.c:784)
3 RWMAppStore 0x0056075c thread_start_routine (wthreads.c:287)
4 RWMAppStore 0x0057b02c GC_start_routine (pthread_support.c:1468)
5 libsystem_c.dylib 0x361c5c16 0x361b6000 + 64534
6 libsystem_c.dylib 0x361c5ad0 0x361b6000 + 64208
Thread 8:
0 libsystem_kernel.dylib 0x33627078 0x33626000 + 4216
1 RWMAppStore 0x0056708c mono_sem_timedwait (mono-semaphore.c:76)
2 RWMAppStore 0x005421a8 async_invoke_thread (threadpool.c:1497)
3 RWMAppStore 0x00548398 start_wrapper (threads.c:784)
4 RWMAppStore 0x0056075c thread_start_routine (wthreads.c:287)
5 RWMAppStore 0x0057b02c GC_start_routine (pthread_support.c:1468)
6 libsystem_c.dylib 0x361c5c16 0x361b6000 + 64534
7 libsystem_c.dylib 0x361c5ad0 0x361b6000 + 64208
Thread 9 Crashed:
0 libsystem_kernel.dylib 0x3363732c 0x33626000 + 70444
1 libsystem_c.dylib 0x36203f54 0x361b6000 + 319316
2 libsystem_c.dylib 0x361fcfe4 0x361b6000 + 290788
3 RWMAppStore 0x00491980 mono_handle_native_sigsegv (mini-exceptions.c:2255)
4 RWMAppStore 0x0047bdd8 mono_sigsegv_signal_handler (mini.c:5923)
5 libsystem_c.dylib 0x3620e532 0x361b6000 + 361778
6 RWMAppStore 0x004dd984 mono_gc_run_finalize (gc.c:113)
7 RWMAppStore 0x004dd984 mono_gc_run_finalize (gc.c:113)
8 RWMAppStore 0x00574a7c GC_invoke_finalizers (finalize.c:787)
9 RWMAppStore 0x004bdb38 mono_gc_invoke_finalizers (boehm-gc.c:549)
10 RWMAppStore 0x004de12c finalizer_thread (gc.c:1055)
11 RWMAppStore 0x00548398 start_wrapper (threads.c:784)
12 RWMAppStore 0x0056075c thread_start_routine (wthreads.c:287)
13 RWMAppStore 0x0057b02c GC_start_routine (pthread_support.c:1468)
14 libsystem_c.dylib 0x361c5c16 0x361b6000 + 64534
15 libsystem_c.dylib 0x361c5ad0 0x361b6000 + 64208
Thread 9 crashed with ARM Thread State:
r0: 0x00000000 r1: 0x00000000 r2: 0x00000001 r3: 0x00000000
r4: 0x00000006 r5: 0x073f6000 r6: 0x00000000 r7: 0x073f5464
r8: 0x3f1eb060 r9: 0x00000000 r10: 0x001068ca r11: 0x01b40234
ip: 0x00000148 sp: 0x073f5458 lr: 0x36203f5b pc: 0x3363732c
cpsr: 0x00000010
It looks like the heap has become corrupted somehow. I can't find anything immediately wrong in the code you're using, but maybe you can try changing this line:
var pStr = Marshal.AllocHGlobal(length);
to
var pStr = Marshal.AllocHGlobal(length * 2);
to see if that works around the issue.
I might be able to get my hands on an iPhone soon where I can test it.
Update
I've tried this on an iPhone4, and it does not crash. This means that it's probably several different things in your app that plays together to create this crash, and the best way to fix/find it would be to file a bug at http://bugzilla.xamarin.com and attaching your project (you can mark the bug private so only Xamarin employees can see it if your project is closed source).
Related
We have an iPad app build with Xamarin.iOS that has started to crash randomly for our customers.
This occurs when users interact with the UI but appears to happen randomly, as they can work fine for hours then, all of a sudden they click on something and the app crashes.
All attempts to replicate locally have failed (both on simulator and on physical devices) but the number of users reporting this has increased, as well as the number of crashes logged in App Center.
Any help/insight into the below call stack would be greatly appreciated.
Exception Type: SIGABRT
Exception Codes: #0 at 0x1bc0febbc
Crashed Thread: 0
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x00000001bc0febbc __pthread_kill + 8
1 libsystem_c.dylib 0x000000018cc336ac abort + 120
2 MyApp 0x0000000112a1bf40 xamarin_unhandled_exception_handler (runtime.m:1109)
3 MyApp 0x00000001128c1bbc mono_invoke_unhandled_exception_hook (exception.c:1265)
4 MyApp 0x0000000112856d28 mono_handle_exception_internal (mini-exceptions.c:2782)
5 MyApp 0x00000001128556fc mono_handle_exception (mini-exceptions.c:3107)
6 MyApp 0x000000011284b3fc mono_arm_throw_exception (exceptions-arm64.c:401)
7 MyApp 0x0000000101371fbc throw_exception + 168
8 MyApp 0x00000001010d613c System_Runtime_ExceptionServices_ExceptionDispatchInfo_Throw + 40
9 MyApp 0x00000001010dc424 System_Runtime_CompilerServices_AsyncMethodBuilderCore__c__ThrowAsyncb__7_0_object + 80
10 MyApp 0x0000000101da69cc Foundation_NSAsyncSynchronizationContextDispatcher_Apply (NSAction.cs:178)
11 MyApp 0x000000010132d8c0 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 268
12 MyApp 0x0000000112868a94 mono_jit_runtime_invoke (mini-runtime.c:3190)
13 MyApp 0x00000001129226c4 mono_runtime_invoke_checked (object.c:3052)
14 MyApp 0x0000000112925f04 mono_runtime_invoke (object.c:3107)
15 MyApp 0x0000000100f09230 native_to_managed_trampoline_7(objc_object*, objc_selector*, _MonoMethod**, unsigned int) (registrar.m:424)
16 MyApp 0x0000000100f09764 -[__MonoMac_NSAsyncSynchronizationContextDispatcher xamarinApplySelector] (registrar.m:6646)
17 Foundation 0x0000000183c066a0 __NSThreadPerformPerform + 160
18 CoreFoundation 0x000000018256a4fc __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 20
19 CoreFoundation 0x000000018257a62c __CFRunLoopDoSource0 + 200
20 CoreFoundation 0x00000001824bc834 __CFRunLoopDoSources0 + 252
21 CoreFoundation 0x00000001824c1f08 __CFRunLoopRun + 764
22 CoreFoundation 0x00000001824d5250 CFRunLoopRunSpecific + 568
23 GraphicsServices 0x00000001a2e20988 GSEventRunModal + 156
24 UIKitCore 0x0000000184cd5a94 -[UIApplication _run] + 1076
25 UIKitCore 0x0000000184a6efd4 UIApplicationMain + 332
26 MyApp 0x0000000101e50c38 wrapper_managed_to_native_UIKit_UIApplication_UIApplicationMain_int_string___intptr_intptr + 340
27 MyApp 0x0000000101dcf3f0 UIKit_UIApplication_Main_string___string_string (UIApplication.cs:75)
28 MyApp 0x0000000100f4b9e0 MyApp_Main_string__ (Main.cs:19)
29 MyApp 0x000000010132d8c0 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 268
30 MyApp 0x0000000112868a94 mono_jit_runtime_invoke (mini-runtime.c:3190)
31 MyApp 0x00000001129226c4 mono_runtime_invoke_checked (object.c:3052)
32 MyApp 0x00000001129289cc mono_runtime_exec_main_checked (object.c:0)
33 MyApp 0x0000000112846e04 mono_jit_exec (driver.c:1383)
34 MyApp 0x0000000112a2e4ac xamarin_main (monotouch-main.m:494)
35 MyApp 0x0000000100f4917c main (main.m:298)
36 ??? 0x0000000113f244d0 0x0 + 0
Thread 1:
0 libsystem_kernel.dylib 0x00000001bc0f9484 __psynch_cvwait + 8
1 MyApp 0x00000001129c58ec thread_func (mono-os-mutex.h:219)
2 libsystem_pthread.dylib 0x00000001dc7ae348 _pthread_start + 112
3 libsystem_pthread.dylib 0x00000001dc7ac948 thread_start + 4
Thread 2:
0 libsystem_kernel.dylib 0x00000001bc0f8ae8 semaphore_wait_trap + 8
1 MyApp 0x000000011297021c start_wrapper_internal (threads.c:1233)
2 MyApp 0x00000001129700a0 start_wrapper (threads.c:1308)
3 libsystem_pthread.dylib 0x00000001dc7ae348 _pthread_start + 112
4 libsystem_pthread.dylib 0x00000001dc7ac948 thread_start + 4
Thread 3:
0 libsystem_kernel.dylib 0x00000001bc0f8aac mach_msg_trap + 8
1 CoreFoundation 0x00000001824bdd88 __CFRunLoopServiceMachPort + 364
2 CoreFoundation 0x00000001824c2090 __CFRunLoopRun + 1156
3 CoreFoundation 0x00000001824d5250 CFRunLoopRunSpecific + 568
4 Foundation 0x0000000183be2eec -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 228
5 Foundation 0x0000000183c22000 -[NSRunLoop(NSRunLoop) runUntilDate:] + 84
6 UIKitCore 0x0000000184c54f00 -[UIEventFetcher threadMain] + 508
7 Foundation 0x0000000183c2fbfc __NSThread__start__ + 788
8 libsystem_pthread.dylib 0x00000001dc7ae348 _pthread_start + 112
9 libsystem_pthread.dylib 0x00000001dc7ac948 thread_start + 4
Thread 4:
0 libsystem_kernel.dylib 0x00000001bc0f9484 __psynch_cvwait + 8
1 MyApp 0x00000001129d4e68 mono_os_cond_timedwait (mono-os-mutex.c:75)
2 MyApp 0x000000011297b944 mono_w32handle_timedwait_signal_handle (mono-coop-mutex.h:103)
3 MyApp 0x000000011297b81c mono_w32handle_wait_one (w32handle.c:0)
4 MyApp 0x000000011297ba40 mono_w32handle_wait_multiple (w32handle.c:1002)
5 MyApp 0x000000011296a748 ves_icall_System_Threading_WaitHandle_Wait_internal (threads.c:2314)
6 MyApp 0x00000001128e66e8 ves_icall_System_Threading_WaitHandle_Wait_internal_raw (icall-def.h:1100)
7 MyApp 0x000000010105efb8 wrapper_managed_to_native_System_Threading_WaitHandle_Wait_internal_intptr__int_bool_int + 116
8 MyApp 0x000000010105eb18 System_Threading_WaitHandle_WaitOneNative_System_Runtime_InteropServices_SafeHandle_uint_bool_bool + 260
9 MyApp 0x000000010105e56c System_Threading_WaitHandle_InternalWaitOne_System_Runtime_InteropServices_SafeHandle_long_bool_bool + 56
10 MyApp 0x000000010105e51c System_Threading_WaitHandle_WaitOne_long_bool + 56
11 MyApp 0x000000010105e41c System_Threading_WaitHandle_WaitOne_int_bool + 56
12 MyApp 0x000000010105e4cc System_Threading_WaitHandle_WaitOne_int + 40
13 MyApp 0x00000001010629f8 System_Threading_Timer_Scheduler_SchedulerThread + 212
14 MyApp 0x0000000101057124 System_Threading_ThreadHelper_ThreadStart + 112
15 MyApp 0x000000010132d8c0 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 268
16 MyApp 0x0000000112868a94 mono_jit_runtime_invoke (mini-runtime.c:3190)
17 MyApp 0x00000001129226c4 mono_runtime_invoke_checked (object.c:3052)
18 MyApp 0x0000000112928060 mono_runtime_delegate_try_invoke (object.c:4438)
19 MyApp 0x0000000112970314 start_wrapper_internal (threads.c:1255)
20 MyApp 0x00000001129700a0 start_wrapper (threads.c:1308)
21 libsystem_pthread.dylib 0x00000001dc7ae348 _pthread_start + 112
22 libsystem_pthread.dylib 0x00000001dc7ac948 thread_start + 4
Thread 5:
0 libsystem_kernel.dylib 0x00000001bc0f96b0 __select + 8
1 MyApp 0x00000001129617a8 poll_event_wait (threadpool-io-poll.c:153)
2 MyApp 0x000000011296121c selector_thread (threadpool-io.c:460)
3 MyApp 0x000000011297021c start_wrapper_internal (threads.c:1233)
4 MyApp 0x00000001129700a0 start_wrapper (threads.c:1308)
5 libsystem_pthread.dylib 0x00000001dc7ae348 _pthread_start + 112
6 libsystem_pthread.dylib 0x00000001dc7ac948 thread_start + 4
Thread 6:
0 libsystem_kernel.dylib 0x00000001bc0f8aac mach_msg_trap + 8
1 CoreFoundation 0x00000001824bdd88 __CFRunLoopServiceMachPort + 364
2 CoreFoundation 0x00000001824c2090 __CFRunLoopRun + 1156
3 CoreFoundation 0x00000001824d5250 CFRunLoopRunSpecific + 568
4 CFNetwork 0x0000000182edaaa8 _CFURLStorageSessionDisableCache + 50416
5 Foundation 0x0000000183c2fbfc __NSThread__start__ + 788
6 libsystem_pthread.dylib 0x00000001dc7ae348 _pthread_start + 112
7 libsystem_pthread.dylib 0x00000001dc7ac948 thread_start + 4
=
We have build this app with the following version of Xamarin.iOS
Xamarin.iOS
Version: 15.10.0.5
Hash: 96b3edb6d
Branch: d17-2
Build date: 2022-05-18 07:32:07-0400
I received a crash in iOS12.
The way to reproduce:
1.Play a video with UIWebView, then the video will play in fullScreen.
2.After the video start play, tap the left-top reduced Button to stop the video.
3.Replay it and the video will still in fullScreeen.
4.Repeat step2 and step3 several times.
5.Normal speed, at most 10 times, the crash will come.
Some detail info of the crash:
Hardware Model: iPhone10,3
Code Type: ARM-64 (Native)
Role: Non UI
Parent Process: launchd [1]
Date/Time: 2018-10-08 18:59:20.8570 +0800
Launch Time: 2018-10-08 18:58:58.7757 +0800
OS Version: iPhone OS 12.0 (16A366)
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x000047c300000111
VM Region Info: 0x47c300000111 is not in any region. Bytes after previous region: 78891569905938
REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL
MALLOC_NANO 0000000280000000-00000002a0000000 [512.0M] rw-/rwx SM=PRV
--->
UNUSED SPACE AT END
Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [658]
Triggered by Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 WebCore 0x00000001be5f4270 VideoFullscreenControllerContext::rateChanged+ 4784752 (bool, float) + 308
1 WebCore 0x00000001be5f4164 VideoFullscreenControllerContext::rateChanged+ 4784484 (bool, float) + 40
2 libdispatch.dylib 0x00000001b529b6c8 _dispatch_call_block_and_release + 24
3 libdispatch.dylib 0x00000001b529c484 _dispatch_client_callout + 16
4 libdispatch.dylib 0x00000001b527bb44 _dispatch_main_queue_callback_4CF$VARIANT$armv81 + 1012
5 CoreFoundation 0x00000001b57f21bc __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
6 CoreFoundation 0x00000001b57ed084 __CFRunLoopRun + 1964
7 CoreFoundation 0x00000001b57ec5b8 CFRunLoopRunSpecific + 436
8 GraphicsServices 0x00000001b7a60584 GSEventRunModal + 100
9 UIKitCore 0x00000001e2117558 UIApplicationMain + 212
10 xxxx 0x00000001023d29e4 main + 59876 (main.m:16)
11 libdyld.dylib 0x00000001b52acb94 start + 4
Thread 1 name: JavaScriptCore bmalloc scavenger
Thread 1:
0 libsystem_kernel.dylib 0x00000001b53f8f0c __psynch_cvwait + 8
1 libsystem_pthread.dylib 0x00000001b547a4c8 _pthread_cond_wait$VARIANT$armv81 + 620
2 libc++.1.dylib 0x00000001b49c44d0 std::__1::condition_variable::wait+ 34000 (std::__1::unique_lock<std::__1::mutex>&) + 24
3 JavaScriptCore 0x00000001bcb5bd7c void std::__1::condition_variable_any::wait<std::__1::unique_lock<bmalloc::Mutex> >+ 376188 (std::__1::unique_lock<bmalloc::Mutex>&) + 104
4 JavaScriptCore 0x00000001bcb5fe70 bmalloc::Scavenger::threadRunLoop+ 392816 () + 176
5 JavaScriptCore 0x00000001bcb5f5a4 bmalloc::Scavenger::Scavenger+ 390564 (std::__1::lock_guard<bmalloc::Mutex>&) + 0
6 JavaScriptCore 0x00000001bcb61050 std::__1::__thread_specific_ptr<std::__1::__thread_struct>::set_pointer+ 397392 (std::__1::__thread_struct*) + 0
7 libsystem_pthread.dylib 0x00000001b547d2fc _pthread_body + 128
8 libsystem_pthread.dylib 0x00000001b547d25c _pthread_start + 48
9 libsystem_pthread.dylib 0x00000001b5480d08 thread_start + 4
Thread 2 name: WebThread
Thread 2:
0 libsystem_kernel.dylib 0x00000001b53eded0 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x00000001b53ed3a8 mach_msg + 72
2 libdispatch.dylib 0x00000001b526d630 _dispatch_mach_send_and_wait_for_reply + 500
3 libdispatch.dylib 0x00000001b526dad0 dispatch_mach_send_with_result_and_wait_for_reply$VARIANT$armv81 + 56
4 libxpc.dylib 0x00000001b54b4eb4 xpc_connection_send_message_with_reply_sync + 204
5 CoreMedia 0x00000001b8f1176c FigXPCRemoteClientSendSyncMessageCreatingReply + 36
6 MediaToolbox 0x00000001ba4e5868 remoteXPCAsset_GetStatusOfValueForProperty + 152
7 AVFoundation 0x00000001bb954930 -[AVFigAssetInspectorLoader _loadStatusForProperty:figAsset:error:] + 84
8 AVFoundation 0x00000001bb954af4 -[AVFigAssetInspectorLoader statusOfValueForKey:error:] + 312
9 WebCore 0x00000001be232e98 WebCore::MediaPlayerPrivateAVFoundationObjC::assetStatus+ 847512 () const + 248
10 WebCore 0x00000001be2213a8 WebCore::MediaPlayerPrivateAVFoundation::updateStates+ 775080 () + 764
11 WebCore 0x00000001be23dcec WebCore::MediaPlayerPrivateAVFoundationObjC::rateDidChange+ 892140 (double) + 24
12 WebCore 0x00000001be2222bc WebCore::MediaPlayerPrivateAVFoundation::dispatchNotification+ 778940 () + 1064
13 JavaScriptCore 0x00000001bcb273e0 WTF::dispatchFunctionsFromMainThread+ 160736 () + 308
14 Foundation 0x00000001b63135a0 __NSThreadPerformPerform + 336
15 CoreFoundation 0x00000001b57f25b8 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
16 CoreFoundation 0x00000001b57f2538 __CFRunLoopDoSource0 + 88
17 CoreFoundation 0x00000001b57f1e1c __CFRunLoopDoSources0 + 176
18 CoreFoundation 0x00000001b57ecce8 __CFRunLoopRun + 1040
19 CoreFoundation 0x00000001b57ec5b8 CFRunLoopRunSpecific + 436
20 WebCore 0x00000001be613ba4 RunWebThread+ 4914084 (void*) + 592
21 libsystem_pthread.dylib 0x00000001b547d2fc _pthread_body + 128
22 libsystem_pthread.dylib 0x00000001b547d25c _pthread_start + 48
23 libsystem_pthread.dylib 0x00000001b5480d08 thread_start + 4
Anyone have any idea?
ps.There are a similar question at Multiple UIWebView WebCore Crashes
recent I used AVPlayer to play while downloading, everything seems fine. Bug I found some crash about AVKeyPathFlattener on the other threads. I can't reproduce and don't know how to solve it. Can you please help me ? Thanks.
Here is the crash log:
#10 Thread
NSInternalInconsistencyException
An instance 0x170031fa0 of class AVKeyPathFlattener was deallocated while key value observers were still registered with it. Current observation info: <NSKeyValueObservationInfo 0x170432860> ( <NSKeyValueObservance 0x17404c660: Observer: 0x170269f80, Key path: operationCount, Options: <New: NO, Old: NO, Prior: NO> Context: 0x0, Property: 0x17404c510> )
0 CoreFoundation ___exceptionPreprocess + 124
1 libobjc.A.dylib objc_exception_throw + 56
2 CoreFoundation -[NSException initWithCoder:]
3 Foundation _NSKVODeallocate + 300
4 AVFoundation -[AVPlayerLayer _stopObservingPlayer:] + 244
5 libdispatch.dylib __dispatch_call_block_and_release + 24
6 libdispatch.dylib __dispatch_client_callout + 16
7 libdispatch.dylib __dispatch_queue_serial_drain + 928
8 libdispatch.dylib __dispatch_queue_invoke + 652
9 libdispatch.dylib __dispatch_queue_override_invoke + 360
10 libdispatch.dylib __dispatch_root_queue_drain + 572
11 libdispatch.dylib __dispatch_worker_thread3 + 124
12 libsystem_pthread.dylib _pthread_wqthread + 1288
13 libsystem_pthread.dylib start_wqthread + 4
#0 Thread
0 libsystem_platform.dylib 0x0000000181a916c0 OSAtomicEnqueue
1 CoreFoundation 0x00000001829b4770 __CFRelease
2 CoreText 0x0000000185674d8c TFont::~TFont()
3 CoreFoundation 0x00000001829b4358 __CFRelease
4 CoreText 0x000000018569df44 CTTateChuYokoRun::CloneRange(CTRun const*, CFRange, TRun::SubrangingStyle)
5 CoreText 0x000000018566c7b4 TFontCascade::~TFontCascade()
6 CoreText 0x0000000185669bf4 TGlyphEncoder::EncodeChars(CFRange, TAttributes const&, TGlyphList&, TGlyphEncoder::Fallbacks)
7 CoreText 0x00000001856693b4 TTypesetterAttrString::Initialize(__CFAttributedString const*)
8 CoreText 0x00000001856690cc TTypesetterAttrString::TTypesetterAttrString(__CFAttributedString const*)
9 CoreText 0x0000000185668fb4 CTLineCreateWithAttributedString
10 UIFoundation 0x0000000188828b18 ___NSStringDrawingEngine
11 UIFoundation 0x0000000188827acc -[NSString(NSExtendedStringDrawing) boundingRectWithSize:options:attributes:context:]
12 UIFoundation 0x0000000188825fec -[NSString(NSStringDrawing) sizeWithAttributes:]
13 MyApp 0x0000000100328240 -[ECAnalysisLyric analysisLyric:withMaxFont:orLyricData:twoline:] (ECAnalysisLyric.m:264)
14 MyApp 0x00000001002a8b34 -[ECArtworkViewController getLyricInfo:] (ECArtworkViewController.m:2685)
15 libdispatch.dylib 0x000000018188e1fc __dispatch_call_block_and_release
16 libdispatch.dylib 0x000000018188e1bc __dispatch_client_callout
17 libdispatch.dylib 0x0000000181892d68 _dispatch_main_queue_callback_4CF
18 CoreFoundation 0x00000001829b2810 _CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE
19 CoreFoundation 0x00000001829b03fc ___CFRunLoopRun
20 CoreFoundation 0x00000001828de2b8 CFRunLoopRunSpecific
21 GraphicsServices 0x0000000184392198 GSEventRunModal
22 UIKit 0x00000001889257fc -[UIApplication _run]
23 UIKit 0x0000000188920534 UIApplicationMain
24 MyApp 0x000000010040e04c main (main.m:14)
25 libdyld.dylib 0x00000001818c15b8 _start
#1Thread com.apple.uikit.eventfetch-thread
0 libsystem_kernel.dylib 0x00000001819b5188 mach_msg_trap
1 libsystem_kernel.dylib 0x00000001819b4ff8 mach_msg
2 CoreFoundation 0x00000001829b25d0 ___CFRunLoopServiceMachPort
3 CoreFoundation 0x00000001829b01ec ___CFRunLoopRun
4 CoreFoundation 0x00000001828de2b8 CFRunLoopRunSpecific
5 Foundation 0x000000018341b26c -[NSRunLoop(NSRunLoop) runMode:beforeDate:]
6 Foundation 0x000000018343bdd0 -[NSRunLoop(NSRunLoop) runUntilDate:]
7 UIKit 0x0000000189299c38 -[UIEventFetcher threadMain]
8 Foundation 0x0000000183518e68 _NSThread__start
9 libsystem_pthread.dylib 0x0000000181a99850 __pthread_body
10 libsystem_pthread.dylib 0x0000000181a99760 __pthread_body
#2 Thread
0 libsystem_kernel.dylib 0x00000001819b5188 mach_msg_trap
1 libsystem_kernel.dylib 0x00000001819b4ff8 mach_msg
2 CoreFoundation 0x00000001829b25d0 ___CFRunLoopServiceMachPort
3 CoreFoundation 0x00000001829b01ec ___CFRunLoopRun
4 CoreFoundation 0x00000001828de2b8 CFRunLoopRunSpecific
5 MyApp 0x00000001003de900 +[ASIHTTPRequest runRequests] (ASIHTTPRequest.m:4913)
6 Foundation 0x0000000183518e68 _NSThread__start
7 libsystem_pthread.dylib 0x0000000181a99850 __pthread_body
8 libsystem_pthread.dylib 0x0000000181a99760 __pthread_body
#3 com.apple.NSURLConnectionLoader
0 libsystem_kernel.dylib 0x00000001819b5188 mach_msg_trap
1 libsystem_kernel.dylib 0x00000001819b4ff8 mach_msg
2 CoreFoundation 0x00000001829b25d0 ___CFRunLoopServiceMachPort
3 CoreFoundation 0x00000001829b01ec ___CFRunLoopRun
4 CoreFoundation 0x00000001828de2b8 CFRunLoopRunSpecific
5 CFNetwork 0x00000001830e3a70 +[NSURLConnection(Loader) _resourceLoadLoop:]
6 Foundation 0x0000000183518e68 _NSThread__start
7 libsystem_pthread.dylib 0x0000000181a99850 __pthread_body
8 libsystem_pthread.dylib 0x0000000181a99760 __pthread_body
#4 AVAudioSession Notify Thread
0 libsystem_kernel.dylib 0x00000001819b5188 mach_msg_trap
1 libsystem_kernel.dylib 0x00000001819b4ff8 mach_msg
2 CoreFoundation 0x00000001829b25d0 ___CFRunLoopServiceMachPort
3 CoreFoundation 0x00000001829b01ec ___CFRunLoopRun
4 CoreFoundation 0x00000001828de2b8 CFRunLoopRunSpecific
5 AVFAudio 0x000000019c57fd24 GenericRunLoopThread::Entry(void*)
6 AVFAudio 0x000000019c5a5d9c CAPThread::Entry(CAPThread*)
7 libsystem_pthread.dylib 0x0000000181a99850 __pthread_body
8 libsystem_pthread.dylib 0x0000000181a99760 __pthread_body
#5 keep live
0 libsystem_kernel.dylib 0x00000001819d3314 __semwait_signal
1 libsystem_c.dylib 0x00000001818f125c nanosleep
2 Foundation 0x0000000183518118 +[NSThread sleepForTimeInterval:]
3 MyApp 0x00000001000ab03c -[EncoreProtoInterface run] (EncoreProtoInterface.mm:119)
4 Foundation 0x0000000183518e68 _NSThread__start
5 libsystem_pthread.dylib 0x0000000181a99850 __pthread_body
6 libsystem_pthread.dylib 0x0000000181a99760 __pthread_body
#6 com.apple.CFSocket.private
0 libsystem_kernel.dylib 0x00000001819d323c __select
1 CoreFoundation 0x00000001829b9468 ___CFSocketManager
2 libsystem_pthread.dylib 0x0000000181a99850 __pthread_body
3 libsystem_pthread.dylib 0x0000000181a99760 __pthread_body
#7 Thread
0 libsystem_kernel.dylib 0x00000001819b51dc semaphore_timedwait_trap
1 libdispatch.dylib 0x00000001818a0770 __dispatch_semaphore_wait_slow
2 libdispatch.dylib 0x000000018189f808 __dispatch_worker_thread
3 libsystem_pthread.dylib 0x0000000181a99850 __pthread_body
4 libsystem_pthread.dylib 0x0000000181a99760 __pthread_body
#8 Thread
0 libsystem_kernel.dylib 0x00000001819d3a88 __workq_kernreturn
1 libsystem_pthread.dylib 0x0000000181a97344 _pthread_wqthread
#9 Thread
0 libsystem_kernel.dylib 0x00000001819d2e1c __psynch_cvwait
1 libsystem_pthread.dylib 0x0000000181a989c0 __pthread_cond_wait
2 Foundation 0x00000001834f25c8 -[__NSOperationInternal _waitUntilFinished:]
3 CFNetwork 0x000000018326154c -[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:]
4 CFNetwork 0x00000001832616c0 -[NSURLConnectionInternal _withActiveConnectionAndDelegate:]
5 CFNetwork 0x000000018321f974 _NSURLConnectionDidReceiveResponse(_CFURLConnection*, _CFURLResponse*, void const*)
6 CFNetwork 0x0000000183185c78 invocation function for block in URLConnectionClient_Classic::_delegate_didReceiveResponse(_CFURLResponse*)
7 CFNetwork 0x00000001831817ac invocation function for block in URLConnectionClient_Classic::_withDelegateAsync(char const*, void (_CFURLConnection*, CFURLConnectionClientCurrent_VMax const*) block_pointer)
8 CFNetwork 0x000000018323e85c invocation function for block in QCoreSchedulingSet::performAsync(void () block_pointer) const
9 libdispatch.dylib 0x000000018188e1fc __dispatch_call_block_and_release
10 libdispatch.dylib 0x000000018188e1bc __dispatch_client_callout
11 libdispatch.dylib 0x000000018189c3dc __dispatch_queue_serial_drain
12 libdispatch.dylib 0x00000001818919a4 __dispatch_queue_invoke
13 libdispatch.dylib 0x000000018189e34c __dispatch_root_queue_drain
14 libdispatch.dylib 0x000000018189e0ac __dispatch_worker_thread3
15 libsystem_pthread.dylib 0x0000000181a972a0 _pthread_wqthread
#11 Thread
0 libsystem_kernel.dylib 0x00000001819d3a88 __workq_kernreturn
1 libsystem_pthread.dylib 0x0000000181a97160 _pthread_wqthread
#12 Thread
0 libsystem_kernel.dylib 0x00000001819d3a88 __workq_kernreturn
1 libsystem_pthread.dylib 0x0000000181a97344 _pthread_wqthread
#13 Thread
0 libsystem_kernel.dylib 0x00000001819d3a88 __workq_kernreturn
1 libsystem_pthread.dylib 0x0000000181a97344 _pthread_wqthread
#14 Thread
0 libsystem_kernel.dylib 0x00000001819d3a88 __workq_kernreturn
1 libsystem_pthread.dylib 0x0000000181a97344 _pthread_wqthread
I am trying to test out the new Google SDK for iOS using the GoogleMapsSample on GitHub, however, every time I run the app crashes trying to create an instance of GMSMapView. This is happening when trying to run on both the simulator and the device.
I have enabled the SDK from the developer console and updated the GMSServices.ProvideAPIKey call to use my iOS API key, from what I have read that is pretty much all that's required?
I did notice this bug which was logged against the actual SDK which mentions an issue relating to OpenGL so not sure if that's what the issue is here. However, as I can't get access to a log using the simulator I ran it on the device and checked the log out using XCode and the error does seem to relate to this - stack trace:
Incident Identifier: {Incident Id}
CrashReporter Key: {CrashReporter key}
Hardware Model: iPhone5,2
Process: GoogleMapsSample [6085]
Path: /var/mobile/Applications/{AppId}/GoogleMapsSample.app/GoogleMapsSample
Identifier: GoogleMapsSample
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2013-02-27 18:28:21.300 +0000
OS Version: iOS 6.0.2 (10A551)
Report Version: 104
Exception Type: EXC_BAD_ACCESS (SIGABRT)
Exception Codes: KERN_INVALID_ADDRESS at 0x00000180
Crashed Thread: 6
Last Exception Backtrace:
0 CoreFoundation 0x372913e2 __exceptionPreprocess + 158
1 libobjc.A.dylib 0x33cc995e objc_exception_throw + 26
2 CoreData 0x32330828 +[NSEntityDescription entityForName:inManagedObjectContext:] + 100
3 GoogleMapsSample 0x0010a3c6 -[GMSTileDataCache fetchTilesImmediateWithPredicate:sortDescriptor:completionHandler:] (GMSTileDataCache.mm:794)
4 GoogleMapsSample 0x00106af0 __47-[GMSTileDataCache startWithCompletionHandler:]_block_invoke_0 (GMSTileDataCache.mm:170)
5 libdispatch.dylib 0x3096478e _dispatch_call_block_and_release + 6
6 libdispatch.dylib 0x30967b36 _dispatch_queue_drain + 138
7 libdispatch.dylib 0x30965678 _dispatch_queue_invoke + 40
8 libdispatch.dylib 0x3096860e _dispatch_root_queue_drain + 206
9 libdispatch.dylib 0x309687d4 _dispatch_worker_thread2 + 88
10 libsystem_c.dylib 0x3337f7ec _pthread_wqthread + 356
11 libsystem_c.dylib 0x3337f680 start_wqthread + 4
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0:
0 dyld 0x2fe9bcf6 ImageLoaderMachOCompressed::trieWalk(unsigned char const*, unsigned char const*, char const*) + 42
1 dyld 0x2fe9be88 ImageLoaderMachOCompressed::findExportedSymbol(char const*, ImageLoader const**) const + 72
2 dyld 0x2fe96ca4 ImageLoaderMachO::findExportedSymbol(char const*, bool, ImageLoader const**) const + 28
3 dyld 0x2fe93592 ImageLoader::findExportedSymbolInDependentImagesExcept(char const*, ImageLoader const**, ImageLoader const**&, ImageLoader const**, ImageLoader const**) const + 50
4 dyld 0x2fe936f0 ImageLoader::findExportedSymbolInImageOrDependentImages(char const*, ImageLoader::LinkContext const&, ImageLoader const**) const + 64
5 dyld 0x2fe91d12 dlsym + 474
6 libdyld.dylib 0x37ad79c6 dlsym + 54
7 libGFXShared.dylib 0x3362e5c4 gfxInitializeLibrary + 1256
8 GLEngine 0x379bce6a gliInitializeLibrary + 42
9 OpenGLES 0x36a9fa4e eagl_init + 418
10 OpenGLES 0x36a9f6a4 -[EAGLSharegroup initWithAPI:sharedWithCompute:] + 116
11 OpenGLES 0x36a9e45e -[EAGLContext initWithAPI:properties:] + 186
12 OpenGLES 0x36a9e2f2 -[EAGLContext initWithAPI:sharedWithCompute:] + 138
13 GoogleMapsSample 0x00081ada -[GMSIOSGLContext initWithAPI:] (GMSIOSGLContext.mm:14)
14 GoogleMapsSample 0x001275b6 gmscore::renderer::GMSIOSGLContextPool::GMSIOSGLContextPool() (GLContextPool.mm:108)
15 GoogleMapsSample 0x0012733a __GetGLContextPool_block_invoke_0 (GLContextPool.mm:204)
16 libdispatch.dylib 0x309645d8 _dispatch_client_callout + 20
17 libdispatch.dylib 0x30965586 dispatch_once_f + 42
18 GoogleMapsSample 0x001272da gmscore::renderer::GLContextPool::GetGLContextPool() (once.h:68)
19 GoogleMapsSample 0x00142b60 -[GMSEntityRendererView initWithFrame:context:] (GMSEntityRendererView.mm:53)
20 GoogleMapsSample 0x001562be -[GMSGestureHandlerView initWithFrame:context:gestures:] (GMSGestureHandlerView.mm:282)
21 GoogleMapsSample 0x000fc6d6 -[GMSVectorMapView initWithFrame:connection:tileServiceRegistry:tileRequestCoordinator:serverControlledParameters:resourceManager:resources:networkMonitor:context:flags:locationPipeline:] (GMSVectorMapView.mm:245)
22 GoogleMapsSample 0x00097bc6 -[GMSVectorMapViewBridge sharedInit:] (GMSVectorMapViewBridge.mm:108)
23 GoogleMapsSample 0x000977f0 -[GMSVectorMapViewBridge initWithFrame:camera:] (GMSVectorMapViewBridge.mm:84)
24 GoogleMapsSample 0x00080caa +[GMSMapView mapWithFrame:camera:] (GMSMapView.m:36)
25 GoogleMapsSample 0x00183058 wrapper_managed_to_native_ApiDefinition_Messaging_IntPtr_objc_msgSend_RectangleF_GMSCamera_intptr_intptr_System_Drawing_RectangleF_GoogleMaps_GMSCamera + 456
26 GoogleMapsSample 0x004ff57c GoogleMapsSample_MapViewController_LoadView (MapViewController.cs:21)
27 GoogleMapsSample 0x00edae94 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 196
28 GoogleMapsSample 0x018ebd84 mono_jit_runtime_invoke (mini.c:5783)
29 GoogleMapsSample 0x0195b644 mono_runtime_invoke (object.c:2790)
30 GoogleMapsSample 0x018d9816 native_to_managed_trampoline_GoogleMapsSample_MapViewController_LoadView (registrar.m:10129)
31 UIKit 0x3805d41c -[UIViewController loadViewIfRequired] + 64
32 UIKit 0x3809dd2c -[UIWindow addRootViewControllerViewIfPossible] + 60
33 UIKit 0x38099ac8 -[UIWindow _setHidden:forced:] + 360
34 UIKit 0x380db19c -[UIWindow makeKeyAndVisible] + 56
35 GoogleMapsSample 0x01549600 wrapper_managed_to_native_MonoTouch_ObjCRuntime_Messaging_void_objc_msgSend_intptr_intptr + 64
36 GoogleMapsSample 0x004ff22c GoogleMapsSample_AppDelegate_FinishedLaunching_MonoTouch_UIKit_UIApplication_MonoTouch_Foundation_NSDictionary (AppDelegate.cs:35)
37 GoogleMapsSample 0x00edae94 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 196
38 GoogleMapsSample 0x018ebd84 mono_jit_runtime_invoke (mini.c:5783)
39 GoogleMapsSample 0x0195b644 mono_runtime_invoke (object.c:2790)
40 GoogleMapsSample 0x018c9608 native_to_managed_trampoline_GoogleMapsSample_AppDelegate_FinishedLaunching (registrar.m:5515)
41 UIKit 0x3809ea74 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 248
42 UIKit 0x3809e5f8 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1164
43 UIKit 0x38096806 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 694
44 UIKit 0x3803ecea -[UIApplication handleEvent:withNewEvent:] + 1006
45 UIKit 0x3803e778 -[UIApplication sendEvent:] + 68
46 UIKit 0x3803e1ba _UIApplicationHandleEvent + 6194
47 GraphicsServices 0x315235f4 _PurpleEventCallback + 588
48 GraphicsServices 0x31523222 PurpleEventCallback + 30
49 CoreFoundation 0x372663e4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 32
50 CoreFoundation 0x37266386 __CFRunLoopDoSource1 + 134
51 CoreFoundation 0x3726520a __CFRunLoopRun + 1378
52 CoreFoundation 0x371d8238 CFRunLoopRunSpecific + 352
53 CoreFoundation 0x371d80c4 CFRunLoopRunInMode + 100
54 UIKit 0x38095440 -[UIApplication _run] + 664
55 UIKit 0x3809228c UIApplicationMain + 1116
56 GoogleMapsSample 0x01576fa8 wrapper_managed_to_native_MonoTouch_UIKit_UIApplication_UIApplicationMain_int_string___intptr_intptr + 236
57 GoogleMapsSample 0x004fef5c GoogleMapsSample_Application_Main_string__ (Main.cs:17)
58 GoogleMapsSample 0x00edae94 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 196
59 GoogleMapsSample 0x018ebd84 mono_jit_runtime_invoke (mini.c:5783)
60 GoogleMapsSample 0x0195b644 mono_runtime_invoke (object.c:2790)
61 GoogleMapsSample 0x0195e3aa mono_runtime_exec_main (object.c:3972)
62 GoogleMapsSample 0x01961cce mono_runtime_run_main (object.c:3602)
63 GoogleMapsSample 0x01905be6 mono_jit_exec (driver.c:1125)
64 GoogleMapsSample 0x019ae5f4 main (main.m:445)
65 GoogleMapsSample 0x0016d20c start + 36
Thread 1 name: Dispatch queue: com.apple.libdispatch-manager
Thread 1:
0 libsystem_kernel.dylib 0x378c25d0 kevent64 + 24
1 libdispatch.dylib 0x30969d22 _dispatch_mgr_invoke + 806
2 libdispatch.dylib 0x30965374 _dispatch_mgr_thread + 32
Thread 2:
0 libsystem_kernel.dylib 0x378d2d98 __workq_kernreturn + 8
1 libsystem_c.dylib 0x3337fad6 _pthread_workq_return + 14
2 libsystem_c.dylib 0x3337f7f2 _pthread_wqthread + 362
3 libsystem_c.dylib 0x3337f680 start_wqthread + 4
Thread 3:
0 libsystem_kernel.dylib 0x378c1e80 semaphore_wait_trap + 8
1 GoogleMapsSample 0x01900992 mono_sem_wait (mono-semaphore.c:115)
2 GoogleMapsSample 0x019a0cea finalizer_thread (gc.c:1078)
3 GoogleMapsSample 0x0198bff6 start_wrapper (threads.c:784)
4 GoogleMapsSample 0x018f3942 thread_start_routine (wthreads.c:287)
5 GoogleMapsSample 0x019392dc GC_start_routine (pthread_support.c:1468)
6 libsystem_c.dylib 0x3338a0de _pthread_start + 306
7 libsystem_c.dylib 0x33389fa4 thread_start + 4
Thread 4 name: WebThread
Thread 4:
0 libsystem_kernel.dylib 0x378c1e30 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x378c1fd0 mach_msg + 48
2 CoreFoundation 0x372662b6 __CFRunLoopServiceMachPort + 126
3 CoreFoundation 0x3726502c __CFRunLoopRun + 900
4 CoreFoundation 0x371d8238 CFRunLoopRunSpecific + 352
5 CoreFoundation 0x371d80c4 CFRunLoopRunInMode + 100
6 WebCore 0x38ef9a58 _ZL12RunWebThreadPv + 440
7 libsystem_c.dylib 0x3338a0de _pthread_start + 306
8 libsystem_c.dylib 0x33389fa4 thread_start + 4
Thread 5:
0 libsystem_kernel.dylib 0x378d2d98 __workq_kernreturn + 8
1 libsystem_c.dylib 0x3337fad6 _pthread_workq_return + 14
2 libsystem_c.dylib 0x3337f7f2 _pthread_wqthread + 362
3 libsystem_c.dylib 0x3337f680 start_wqthread + 4
Thread 6 name: Dispatch queue: com.google.maps.TileDataCacheQueue
Thread 6 Crashed:
0 libsystem_kernel.dylib 0x378d2350 __pthread_kill + 8
1 libsystem_c.dylib 0x333a7fb2 pthread_kill + 54
2 libsystem_c.dylib 0x333e4366 abort + 90
3 GoogleMapsSample 0x019330a4 mono_handle_native_sigsegv (mini-exceptions.c:2325)
4 GoogleMapsSample 0x018ea55e mono_sigsegv_signal_handler (mini.c:5878)
5 libsystem_c.dylib 0x333b1d38 _sigtramp + 40
6 GoogleMapsSample 0x01994b34 mono_domain_get (domain.c:1818)
7 GoogleMapsSample 0x0195b644 mono_runtime_invoke (object.c:2790)
8 GoogleMapsSample 0x019c0058 monotouch_throw_monotouch_exception (monotouch-glue.m:1420)
9 GoogleMapsSample 0x019c00e8 monotouch_exception_handler (monotouch-glue.m:1426)
10 CoreFoundation 0x372916cc __handleUncaughtException + 624
11 libobjc.A.dylib 0x33cc9a46 _ZL15_objc_terminatev + 126
12 libc++abi.dylib 0x361ee118 _ZL19safe_handler_callerPFvvE + 76
13 libc++abi.dylib 0x361ee1b0 std::terminate() + 16
14 libc++abi.dylib 0x361ef59a __cxa_throw + 118
15 libobjc.A.dylib 0x33cc999e objc_exception_throw + 90
16 CoreData 0x32330828 +[NSEntityDescription entityForName:inManagedObjectContext:] + 100
17 GoogleMapsSample 0x0010a3c6 -[GMSTileDataCache fetchTilesImmediateWithPredicate:sortDescriptor:completionHandler:] (GMSTileDataCache.mm:794)
18 GoogleMapsSample 0x00106af0 __47-[GMSTileDataCache startWithCompletionHandler:]_block_invoke_0 (GMSTileDataCache.mm:170)
19 libdispatch.dylib 0x30964790 _dispatch_call_block_and_release + 8
20 libdispatch.dylib 0x30967b36 _dispatch_queue_drain + 138
21 libdispatch.dylib 0x30965678 _dispatch_queue_invoke + 40
22 libdispatch.dylib 0x30968610 _dispatch_root_queue_drain + 208
23 libdispatch.dylib 0x309687d4 _dispatch_worker_thread2 + 88
24 libsystem_c.dylib 0x3337f7ee _pthread_wqthread + 358
25 libsystem_c.dylib 0x3337f680 start_wqthread + 4
Thread 6 crashed with ARM Thread State (32-bit):
r0: 0x00000000 r1: 0x00000000 r2: 0x00000000 r3: 0x3a484524
r4: 0x00000006 r5: 0x0aa4c000 r6: 0x01a14b1e r7: 0x0aa4af9c
r8: 0x00000000 r9: 0x3a480898 r10: 0x01a14b44 r11: 0x05a9385c
ip: 0x00000148 sp: 0x0aa4af90 lr: 0x333a7fb7 pc: 0x378d2350
cpsr: 0x00000010
Version info:
Mono 2.10.11 (mono-2-10/2baeee2)
GTK 2.24.14
GTK# (2.12.0.0)
Package version: 210110000
Xcode 4.5.1 (1842)
Build 4G1004
Monotouch: 6.2.0.65
Any ideas?
Update #2
Google suggested a workaround and it has been implemented. I have successfully deployed to device :) you can find the working solution on MonoTouch-Bindings Repo
Google will fix this on their upcoming release as stated here.
Happy Coding
Update
There is a bug on Google Maps that makes it impossible to use it in Xamarin.iOS, this bug has been reported to google here
http://code.google.com/p/gmaps-api-issues/issues/detail?id=5018
Please Star it so google notices and fixes it faster ;)
I have updated the bindings to version 1.1.0 of Google Maps you can find them here https://github.com/mono/monotouch-bindings/tree/master/GoogleMaps
Please note I have not updated the sample to reflect the Api changes yet.
Hope this helps
Alex
Xamarin did not update to the newer version since they did the last update on 14 december. I believe that this crash relates to this issue. Maybe the API keys you can generate today are just build for 1.1.0 and newer.
If this is not the right forum to ask such question, please point me to the right one.
The app I am working on uses the location of the user and alert the user when certain condition is met. The alert is in form of vibration and a playback of a small file. During testing on the device, the phone vibrates and the audio clip plays for 2 seconds (the clip is about 9 secs long) and the app crashes. The crashes are consistent on the device. On the simulator, occasionally, I see the crashes but not consistent.
The trigger to set off the alert is in the delegate method of CLLocation class
- (void)locationManager:manager didUpdateToLocation:fromLocation:
Here's the code fragment (ivLocMgr is an instance variable)
if ((!ivAlertAlreadyShown) && (<test for trigger condition)) {
ivAlertAlreadyShown = YES;
[self obviousNotification];
[ivLocMgr stopUpdatingLocation];
[ivLocMgr release], ivLocMgr = nil;
}
Can the [ivLocMgr stopUpdatingLocation]; be the root cause?
Any and all help is greatly appreciated.
-S-
Incident Identifier: 8875BB08-4DAD-4FC7-8DC6-AA5D52D6FC78
CrashReporter Key: f995a257bad99baa2fcf0f7d5b0ab3e77dce3a91
Hardware Model: iPhone2,1
Process: SAlert [360]
Path: /var/mobile/Applications/D3B5BAED-036C-4CFE-A735-A61D6ECCDAF6/SAlert.app/SpAlert
Identifier: SAlert
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2011-08-30 07:35:41.206 -0700
OS Version: iPhone OS 4.2.1 (8C148a)
Report Version: 104
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x46924508
Crashed Thread: 0
Thread 0 Crashed:
0 libobjc.A.dylib 0x3199f464 objc_msgSend + 16
1 CoreLocation 0x30e1f430 -[CLLocationManager onClientEventLocation:] + 560
2 CoreLocation 0x30e1d68e -[CLLocationManager onClientEvent:supportInfo:] + 98
3 CoreLocation 0x30e1d804 OnClientEvent + 16
4 CoreLocation 0x30e19522 CLClientInvokeCallback(__CLClient*, CLClientEvent, __CFDictionary const*) + 42
5 CoreLocation 0x30e1b3cc CLClientHandleDaemonDataLocation(__CLClient*, CLClientLocation const*, __CFDictionary const*) + 196
6 CoreLocation 0x30e1b512 CLClientHandleDaemonData(__CFMessagePort*, long, __CFData const*, void*) + 286
7 CoreFoundation 0x314913fe __CFMessagePortPerform + 242
8 CoreFoundation 0x314656f8 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 20
9 CoreFoundation 0x314656bc __CFRunLoopDoSource1 + 160
10 CoreFoundation 0x31457f76 __CFRunLoopRun + 514
11 CoreFoundation 0x31457c80 CFRunLoopRunSpecific + 224
12 CoreFoundation 0x31457b88 CFRunLoopRunInMode + 52
13 GraphicsServices 0x35d664a4 GSEventRunModal + 108
14 GraphicsServices 0x35d66550 GSEventRun + 56
15 UIKit 0x338d5322 -[UIApplication _run] + 406
16 UIKit 0x338d2e8c UIApplicationMain + 664
17 StopAlert 0x00002f76 0x1000 + 8054
18 StopAlert 0x00002f40 0x1000 + 8000
Thread 1:
0 libSystem.B.dylib 0x31192974 kevent + 24
1 libSystem.B.dylib 0x3123c704 _dispatch_mgr_invoke + 88
2 libSystem.B.dylib 0x3123c174 _dispatch_queue_invoke + 96
3 libSystem.B.dylib 0x3123bb98 _dispatch_worker_thread2 + 120
4 libSystem.B.dylib 0x311e024a _pthread_wqthread + 258
5 libSystem.B.dylib 0x311d8970 start_wqthread + 0
Thread 2:
0 libSystem.B.dylib 0x31166268 mach_msg_trap + 20
1 libSystem.B.dylib 0x31168354 mach_msg + 44
2 CoreFoundation 0x31458648 __CFRunLoopServiceMachPort + 88
3 CoreFoundation 0x31457ed2 __CFRunLoopRun + 350
4 CoreFoundation 0x31457c80 CFRunLoopRunSpecific + 224
5 CoreFoundation 0x31457b88 CFRunLoopRunInMode + 52
6 WebCore 0x33d9f124 RunWebThread(void*) + 332
7 libSystem.B.dylib 0x311df886 _pthread_start + 242
8 libSystem.B.dylib 0x311d4a88 thread_start + 0
Thread 3:
0 libSystem.B.dylib 0x31166268 mach_msg_trap + 20
1 libSystem.B.dylib 0x31168354 mach_msg + 44
2 CoreFoundation 0x31458648 __CFRunLoopServiceMachPort + 88
3 CoreFoundation 0x31457ed2 __CFRunLoopRun + 350
4 CoreFoundation 0x31457c80 CFRunLoopRunSpecific + 224
5 CoreFoundation 0x31457b88 CFRunLoopRunInMode + 52
6 Foundation 0x31cf15f6 +[NSURLConnection(NSURLConnectionReallyInternal) _resourceLoadLoop:] + 206
7 Foundation 0x31ccf192 -[NSThread main] + 38
8 Foundation 0x31cc8242 __NSThread__main__ + 966
9 libSystem.B.dylib 0x311df886 _pthread_start + 242
10 libSystem.B.dylib 0x311d4a88 thread_start + 0
Thread 4:
0 libSystem.B.dylib 0x3118a68c select$DARWIN_EXTSN + 20
1 CoreFoundation 0x3148f662 __CFSocketManager + 582
2 libSystem.B.dylib 0x311df886 _pthread_start + 242
3 libSystem.B.dylib 0x311d4a88 thread_start + 0
Thread 5:
0 libSystem.B.dylib 0x31166268 mach_msg_trap + 20
1 libSystem.B.dylib 0x31168354 mach_msg + 44
2 CoreFoundation 0x31458648 __CFRunLoopServiceMachPort + 88
3 CoreFoundation 0x31457ed2 __CFRunLoopRun + 350
4 CoreFoundation 0x31457c80 CFRunLoopRunSpecific + 224
5 CoreFoundation 0x31457b88 CFRunLoopRunInMode + 52
6 MapKit 0x347a2906 TileCachePrivate::runCacheThread() + 274
7 MapKit 0x347a27ea _runCacheThread(void*) + 2
8 libSystem.B.dylib 0x311df886 _pthread_start + 242
9 libSystem.B.dylib 0x311d4a88 thread_start + 0
Thread 6:
0 libSystem.B.dylib 0x311de9f0 __semwait_signal + 24
1 libSystem.B.dylib 0x311937ec _pthread_cond_wait + 748
2 libSystem.B.dylib 0x311933d2 pthread_cond_wait + 26
3 QuartzCore 0x30a925dc CA::DispatchGroup::thread(void*) + 84
4 QuartzCore 0x30a5f01a thread_fun + 10
5 libSystem.B.dylib 0x311df886 _pthread_start + 242
6 libSystem.B.dylib 0x311d4a88 thread_start + 0
Thread 7:
0 libSystem.B.dylib 0x31166268 mach_msg_trap + 20
1 libSystem.B.dylib 0x31168354 mach_msg + 44
2 libSystem.B.dylib 0x3118af5a thread_policy + 118
3 libSystem.B.dylib 0x3118aed2 pthread_setschedparam_internal + 62
4 libSystem.B.dylib 0x3118ae0e pthread_setschedparam + 70
5 TextInput 0x31e8128a KB::kb_set_thread_priority(int) + 18
6 TextInput 0x31e71f74 KB::BackgroundLoad(void*) + 84
7 libSystem.B.dylib 0x311df886 _pthread_start + 242
8 libSystem.B.dylib 0x311d4a88 thread_start + 0
Thread 0 crashed with ARM Thread State:
r0: 0x0403000f r1: 0x33baf8ef r2: 0x30e4bff6 r3: 0x00000001
r4: 0x46924500 r5: 0x30e1d7f5 r6: 0x00a01c64 r7: 0x2fdfec44
r8: 0x00000000 r9: 0x040fc098 r10: 0x00000000 r11: 0x00000000
ip: 0x3e16c584 sp: 0x2fdfeaa0 lr: 0x30e1f437 pc: 0x3199f464
cpsr: 0x200f0030
Found the answer on Apple Developers' Forum:
I needed to set the coreLocation instance's delegate to nil, when the alarm was triggered.
There isn't enough code there to properly determine the cause of the abort. The error you are getting is telling you that you are trying to access a variable that has already been released. I would start there and make sure you haven't released your location manager or some other variable there.