在Xamarin.IOS中执行本机代码时获得了SIGSEGV

时间:2017-09-13 13:50:56

标签: xamarin xamarin.ios xamarin.forms xamarin-studio sigsegv

模拟器和xamarin之间的链接在几秒钟后停止(模拟器为白色)并且我能够再次按下播放按钮。我为这个iOS项目使用Xamarin.Forms。我已经在Xamarin Studio和Visual Studio的最新版本中尝试过这个。

原生堆栈跟踪:

2017-09-13 14:22:34.113 NewsTestOne.iOS[25106:19993674] critical:   0   NewsTestOne.iOS                     0x0000000106847184
mono_handle_native_crash + 244
2017-09-13 14:22:34.113 NewsTestOne.iOS[25106:19993674] critical:   1   NewsTestOne.iOS                     0x000000010685320b mono_sigsegv_signal_handler + 171
2017-09-13 14:22:34.114 NewsTestOne.iOS[25106:19993674] critical:   2   libsystem_platform.dylib            0x000000010d451b3a _sigtramp + 26
2017-09-13 14:22:34.114 NewsTestOne.iOS[25106:19993674] critical:   3   ???                                 0x0003f78b358d56aa 0x0 + 1116602201101994
2017-09-13 14:22:34.114 NewsTestOne.iOS[25106:19993674] critical:   4   CFNetwork                           0x000000010bc51e2e _ZN15TCPIOConnection16_startConnectionEv + 530
2017-09-13 14:22:34.114 NewsTestOne.iOS[25106:19993674] critical:   5   CFNetwork                           0x000000010bd8e32a ___ZN4Tube23_onqueue_prepConnectionEU13block_pointerFvvEU13block_pointerFviE_block_invoke.67 + 726
2017-09-13 14:22:34.114 NewsTestOne.iOS[25106:19993674] critical:   6   CFNetwork                           0x000000010bd8e807 ___ZN4Tube23_onqueue_prepConnectionEU13block_pointerFvvEU13block_pointerFviE_block_invoke_2.83 + 21
2017-09-13 14:22:34.115 NewsTestOne.iOS[25106:19993674] critical:   7   libdispatch.dylib                   0x000000010d0ae585 _dispatch_call_block_and_release + 12
2017-09-13 14:22:34.115 NewsTestOne.iOS[25106:19993674] critical:   8   libdispatch.dylib                   0x000000010d0cf792 _dispatch_client_callout + 8
2017-09-13 14:22:34.115 NewsTestOne.iOS[25106:19993674] critical:   9   libdispatch.dylib                   0x000000010d0b5237 _dispatch_queue_serial_drain + 1022
2017-09-13 14:22:34.115 NewsTestOne.iOS[25106:19993674] critical:   10  libdispatch.dylib                   0x000000010d0b598f _dispatch_queue_invoke + 1053
2017-09-13 14:22:34.115 NewsTestOne.iOS[25106:19993674] critical:   11  libdispatch.dylib                   0x000000010d0b7899 _dispatch_root_queue_drain + 813
2017-09-13 14:22:34.116 NewsTestOne.iOS[25106:19993674] critical:   12  libdispatch.dylib                   0x000000010d0b750d _dispatch_worker_thread3 + 113
2017-09-13 14:22:34.116 NewsTestOne.iOS[25106:19993674] critical:   13  libsystem_pthread.dylib             0x000000010d4635a2 _pthread_wqthread + 1299
2017-09-13 14:22:34.116 NewsTestOne.iOS[25106:19993674] critical:   14  libsystem_pthread.dylib             0x000000010d46307d start_wqthread + 13
2017-09-13 14:22:34.116 NewsTestOne.iOS[25106:19993674] critical: 

=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================

1 个答案:

答案 0 :(得分:0)

这通常表示您的代码存在线程错误,我建议您调试所有异步的服务器端调用,它可以是很多类似的东西:

  • 在尝试更新UI属性的后台线程中运行的Task.Run方法。

  • 在异步任务中使用的Custom RendererDependency Service

  • 如果您的代码中有计时器,请查看这些计时器。

使用最新版本的Xamarin,调试器无法正确调试本机代码,因此请确保清理解决方案并尝试在真实设备上进行调试。 (也有时候摆脱破发点会有所帮助。)